From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fa528,f7f68e18cfb8d31b X-Google-Attributes: gidfa528,public X-Google-Thread: 1012a6,f7f68e18cfb8d31b X-Google-Attributes: gid1012a6,public X-Google-ArrivalTime: 2003-12-25 14:22:05 PST Path: archiver1.google.com!news2.google.com!newsfeed2.dallas1.level3.net!news.level3.com!news-out.visi.com!petbe.visi.com!news.state.mn.us!arclight.uoregon.edu!hammer.uoregon.edu!logbridge.uoregon.edu!newsfeed.stanford.edu!news-proxy.abbnm.com!newsboy.eng.abbnm.com!not-for-mail From: peter@abbnm.com (Peter da Silva) Newsgroups: comp.unix.shell,comp.unix.tru64 Subject: Re: Unexpected result from grep Date: Thu, 25 Dec 2003 22:15:21 +0000 (UTC) Organization: ABB Inc., Network Management Division Message-ID: References: NNTP-Posting-Host: grendel.eng.abbnm.com X-Trace: jeeves.eng.abbnm.com 1072390521 70506 198.178.0.150 (25 Dec 2003 22:15:21 GMT) X-Complaints-To: usenet@jeeves.eng.abbnm.com NNTP-Posting-Date: Thu, 25 Dec 2003 22:15:21 +0000 (UTC) X-Newsreader: trn 4.0-test76 (Apr 2, 2001) Originator: peter@abbnm.com (Peter da Silva) Xref: archiver1.google.com comp.unix.shell:3854 comp.unix.tru64:11061 In article , Stephane CHAZELAS wrote: > RESULT=`"$COMMAND" -E "$1" "$2" 2>/dev/null` > The outer quotes are not necessary here. Right you are, that's what I get for not testing what I was posting, and depending on "I know this works, now let's make sure I'm doing it right" instead of "I know this works, and... I think this is it". > The `...` command substitution is a portability nightmare, Anything that requires more than two levels of quoting is a problem, and a sign that maybe you need to rethink doing this in the shell. > See info -f autoconf -n 'Portable Shell' Autoconf is one of those programs that's pushing the shell far beyond the limits of sanity. Using autoconf is a sign that your program is getting to be a bit of a portability challenge and it's time to consider rewriting that code with all the #ifdefs and odd macros in system calls. Like I said elsewhere... I'm not talking about what you need to do to make multi-hundred-line masterpieces portable, just that 90% of all scripts don't get anywhere near the bleeding edge and don't need anything more than /bin/sh. -- I've seen things you people can't imagine. Chimneysweeps on fire over the roofs of London. I've watched kite-strings glitter in the sun at Hyde Park Gate. All these things will be lost in time, like chalk-paintings in the rain. `-_-' Time for your nap. | Peter da Silva | Har du kramat din varg, idag? 'U`