Xref: utzoo comp.unix.questions:18842 comp.unix.wizards:20036 Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!uwm.edu!uakari.primate.wisc.edu!aplcen!haven!adm!cmcl2!stealth.acf.nyu.edu!brnstnd From: brnstnd@stealth.acf.nyu.edu Newsgroups: comp.unix.questions,comp.unix.wizards Subject: Re: AWK/shell quoting Message-ID: <4614@stealth.acf.nyu.edu> Date: 7 Jan 90 22:34:25 GMT References: <487@longway.TIC.COM> <166@omaha1.UUCP> <18067@umn-cs.CS.UMN.EDU> <1990Jan6.233340.9978@smsc.sony.com> <2367@leah.Albany.Edu> <6954@lindy.Stanford.EDU> Reply-To: brnstnd@stealth.acf.nyu.edu (Dan Bernstein) Distribution: usa Organization: IR Lines: 21 In article <6954@lindy.Stanford.EDU> karish@forel.stanford.edu (Chuck Karish) writes: > awk 'BEGIN {print "'"'"'"}' > 1234321 That numbering may confuse some readers. How about this: awk 'BEGIN {print "'"'"'"}' 1--------------1 2--2 3-3 4 - 4 5 The shell leaves single-quoted text (1-1,2-2) alone. It does a bit of interpretation (none in this case) on the double-quoted text (3-3). Awk sees a double-quoted string (4-4) and prints it. The string, of course, is the completely uninterpreted single quote (5). I would replace the "'" (3-3) by \', which is a few microseconds faster and might save a bit of disk space and typing time. :-) ---Dan