[prev in list] [next in list] [prev in thread] [next in thread] 

List:       ast-users
Subject:    Re: [ast-users] awk: how to print quote
From:       Cyrille Lefevre <cyrille.lefevre-lists () laposte ! net>
Date:       2008-10-04 7:21:42
Message-ID: 48E71986.8030507 () laposte ! net
[Download RAW message or body]


gene golub a écrit :
> Hi folks
>  
> Can you help me: how to print quote with 'print' stm in awk.
>  
> Gene.

it depends, if you are running a plain awk file using #!/usr/bin/awk,
print "'" should work
if you are running an awk script through shell as awk '...', some 
solutions are :
# the one I prefer
awk -v q="'" '{print q "helo" q}'
# a lot complicated
awk 'BEGIN { q="'"'"'" } { print q "helo" q }'
# see man ascii
awk 'BEGIN { q="\047" } { print q "helo" q }'
awk '{ print "\047helo\047" }'

Regards,

Cyrille Lefevre
-- 
mailto:Cyrille.Lefevre-lists@laposte.net



_______________________________________________
ast-users mailing list
ast-users@research.att.com
https://mailman.research.att.com/mailman/listinfo/ast-users
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic