Xref: utzoo comp.unix.questions:18840 comp.unix.wizards:20034 Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!shadooby!yale!cmcl2!stealth.acf.nyu.edu!brnstnd From: brnstnd@stealth.acf.nyu.edu Newsgroups: comp.unix.questions,comp.unix.wizards Subject: Re: AWK/shell quoting (was: Re: Access to UNIX-Related Publications) Message-ID: <4474@stealth.acf.nyu.edu> Date: 7 Jan 90 22:04:43 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> Reply-To: brnstnd@stealth.acf.nyu.edu (Dan Bernstein) Distribution: usa Organization: IR Lines: 15 In article <2367@leah.Albany.Edu> emb978@leah.Albany.EDU.UUCP (Eric M. Boehm) writes: > awk 'BEGIN { print "\'" }' The shell will parse that line into the following chunks: awk 'BEGIN { print "\'" }' ^^^ ^^^^ and we're missing a " here. ^^^^^^^^^^^^^^^^^^ this is all single-quoted The backslash doesn't affect the quote because nothing inside single quotes is interpreted (except history references). 'he\'s' is parsed as the string he\, followed by s, followed by an unmatched single quote. Instead of \' you want to escape from single quoting: '\''. ---Dan