Xref: utzoo comp.unix.questions:18839 comp.unix.wizards:20033 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: <4416@stealth.acf.nyu.edu> Date: 7 Jan 90 21:57:35 GMT References: <487@longway.TIC.COM> <166@omaha1.UUCP> <18067@umn-cs.CS.UMN.EDU> Reply-To: brnstnd@stealth.acf.nyu.edu (Dan Bernstein) Distribution: usa Organization: IR Lines: 30 X-Shell-Quoting-Expertise: Guru (Steve, perhaps my quote and makealias aliases should be in the FAQ list?) The problem is to feed awk the program BEGIN {print "'"} from csh. Those not yet sufficiently experienced to simply write down a solution can use my quote alias: % quote BEGIN {print "'"} (you type this) ^D 'BEGIN {print "'\''"}' So % awk 'BEGIN {print "'\''"}' works. And the aliases, in one of my login files: a quote "/bin/sed 's/\\!/\\\\\!/g' | /bin/sed 's/'\\\''/'\\\'\\\\\\\'\\\''/g' | /bin/sed 's/^/'\''/' | /bin/sed 's/"\$"/'\''/'" a makealias "quote | /bin/sed 's/^/alias \!:1 /' \!:2*" a is aliased to alias. The quote alias should be all on one line. (On most machines, you can replace the multiple sed by a single sed with multiple -e's; unfortunately, this isn't as portable.) quote converts its input into a csh-compatible quoted output. If you've just typed an amazing command and want to save it as an alias ``foo'', type % makealias foo > addto.login (retype the command here and type ^D) If addto.login looks okay, add it to .login. Or use >>.login directly. ---Dan