Xref: utzoo comp.unix.questions:18832 comp.unix.wizards:20028 Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!wuarchive!zaphod.mps.ohio-state.edu!rpi!leah!emb978 From: emb978@leah.Albany.Edu (Eric M. Boehm) Newsgroups: comp.unix.questions,comp.unix.wizards Subject: Re: AWK/shell quoting (was: Re: Access to UNIX-Related Publications) Summary: Escape the single quote! Message-ID: <2367@leah.Albany.Edu> Date: 7 Jan 90 06:59:03 GMT References: <487@longway.TIC.COM> <166@omaha1.UUCP> <18067@umn-cs.CS.UMN.EDU> <1990Jan6.233340.9978@smsc.sony.com> Reply-To: emb978@leah.Albany.EDU.UUCP (Eric M. Boehm) Organization: State University of New York at Albany Lines: 22 In article <18067@umn-cs.CS.UMN.EDU> mike@umn-cs.cs.umn.edu (Mike Haertel) writes: >In article <166@omaha1.UUCP> wcc@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@leah.Albany.EDU EMB978@ALBNYVMS.BITNET