Search the web
Sign In
New User? Sign Up
geeksthatgawk · for GNU Awk questions & discussions
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Message search is now enhanced, find messages faster. Take it for a spin.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
mawk: print command with special characters?   Message List  
Reply | Forward Message #202 of 221 |
Re: [Geeks that Gawk] mawk: print command with special characters?

> Try this (use \\\")
>
> gawk "BEGIN {print \"\\\"hello\\\"\"}"
> "hello"

HASTA LA VISTA ***BABY***
that was my silver bullet! i tried variants on what you wrote and
finally stumbled on the solution:

i did:
mawk "{print $1, \"\\\"\"}"

and it did:
"

YES! i'm not gonna waste my time trying to decipher the logic of it,
just thank the Lord that it works. and it only takes 8 characters to
specify that one character!

now i have one more problem though. i want to print a literal string
constant. it won't do it:

i do:
mawk "{print "word"}"

and it does:


.... nothing! no errors, but no output either. am i doin something wrong?

mike

BTW, i'm on 98se, mawk 1.22x






Thu Jul 6, 2006 3:14 am

spillikinaer...
Online Now Online Now
Send Email Send Email

Forward
Message #202 of 221 |
Expand Messages Author Sort by Date

Hi, can someone help me with this? i want the print command to print a double quote mark as part of a string. mawk won't have it. a double quote is a control...
spillikinaerospace
spillikinaer...
Online Now Send Email
Jul 5, 2006
3:47 am

Might try a Single Quote ( ' ) or a backslash-Single Quote ( \' )... if that works you could use a Double Single Quote to give the illusion of a Double Quote...
Stout, Danny
dasthcc
Offline Send Email
Jul 5, 2006
2:18 pm

Try this (use \\\") gawk "BEGIN {print \"\\\"hello\\\"\"}" "hello" I tested it on Windows XP running win32 port gawk 3.1.3 from...
Ambrosio Berdijo
aberdijo
Offline Send Email
Jul 5, 2006
3:18 pm

... HASTA LA VISTA ***BABY*** that was my silver bullet! i tried variants on what you wrote and finally stumbled on the solution: i did: mawk "{print $1,...
spillikinaerospace
spillikinaer...
Online Now Send Email
Jul 6, 2006
12:16 pm

Mike... what would happen if you did a: gawk "{print 'word' }" or gawk "{print \"word\" }" (the idea being for the command line interpreter to know what double...
Stout, Danny
dasthcc
Offline Send Email
Jul 6, 2006
12:38 pm

... BINGO!!! that did the trick. i suppose with mawk there's just alot of guesswork involved. oh well, i got done what i wanted to get done. thanks Danny...
spillikinaerospace
spillikinaer...
Online Now Send Email
Jul 7, 2006
4:21 am

Kindly help me anybody!!!! how to create an index file? pleeeeeeeeeeeeeeeeeese Ambrosio Berdijo <aberdijo@...> wrote:...
ylng
naghems
Offline Send Email
Aug 6, 2006
12:37 pm

thanx, but no luck yet...
spillikinaerospace
spillikinaer...
Online Now Send Email
Jul 6, 2006
7:18 pm

Hi frenz How to create index file in gawk? am unable to do this...... If I use sorting and grepping it is taking lot of time. Please anybody help me. and do...
ylng
naghems
Offline Send Email
Jul 8, 2006
4:15 pm
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help