AWK/shell quoting (was: Re: Access to UNIX-Related Publications)

Eric M. Boehm emb978 at leah.Albany.Edu
Sun Jan 7 17:59:03 AEST 1990


In article <18067 at umn-cs.CS.UMN.EDU> mike at umn-cs.cs.umn.edu (Mike Haertel) writes:
>In article <166 at omaha1.UUCP> wcc at omaha1.UUCP (William C Carey) writes:
>>Any of the luminaries out there know how to get 'awk' (not nawk) to ouput a
>>single-quote character ( ascii 0x27 ).
>2.  You can do it by cooperating with shell quoting.  This is hairy,
>but will print a single quote:
>
>	awk 'BEGIN {print "'"'"'"}'

This solutions seem to be overly complex. Maybe I'm picking nits but
wouldn't this be easier and simpler?

awk 'BEGIN { print "\'" }'

Why go through all the silliness with " ' "'" ' " when you can just
escape the single quote? Or is there something I am missing?


-- 
Eric M. Boehm
EMB978 at leah.Albany.EDU
EMB978 at ALBNYVMS.BITNET



More information about the Comp.unix.questions mailing list