Xref: utzoo comp.unix.questions:18850 comp.unix.wizards:20048 Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cs.utexas.edu!samsung!caesar.cs.montana.edu!ogicse!decwrl!crltrx!decvax!gsg!lew From: lew@gsg.UUCP (Paul Lew) Newsgroups: comp.unix.questions,comp.unix.wizards Subject: Re: AWK/shell quoting (was: Re: Access to UNIX-Related Publications) Message-ID: <465@gsg.UUCP> Date: 7 Jan 90 21:02:40 GMT References: <487@longway.TIC.COM> <166@omaha1.UUCP> <18067@umn-cs.CS.UMN.EDU> Organization: General Systems Group, Inc., Salem, NH Lines: 25 >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 ). I can't get the 'print' or >the 'printf' statement to do it with any combination of backslashes, >double-quotes, or percent characters. Try avoid using quotes, double-quotes will make life a lot easier. I use the following: BEGIN { q = 39; } { printf "this is a quote: %c\n", q; } this free you up to worry about what you want to do instead of quoting problem. Just remember the decimal value for quote is 39, I did not start using this method until I memorized its value (the most intuitive reaction a programmer has at that point is to use "quote" mostly because he can not remember the decimal value for quote and dont feel like look into the ASCII table for it!) -- Paul Lew (lew@gsg.gsg.com) UUCP: oliveb---+ uunet---samsung--+ General Systems Group, 5 Manor Parkway harvard--+--gsg--lew Salem, NH 03079 (603) 893-1000 decvax---+