Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!hellgate.utah.edu!dog.ee.lbl.gov!nosc!crash!orbit!zuhause!bruce From: bruce@zuhause.MN.ORG (Bruce Albrecht) Newsgroups: comp.sys.amiga.tech Subject: Re: PIPEs Message-ID: Date: 8 Nov 90 02:04:33 GMT References: <1990Nov4.072423.408@agate.berkeley.edu> <1990Nov4.150403.28982@cbnewsc.att.com> <6990@sugar.hackercorp.com> Lines: 32 >In article <6990@sugar.hackercorp.com> peter@sugar.hackercorp.com (Peter da Silva) writes: >In article <1990Nov4.150403.28982@cbnewsc.att.com> gregg@cbnewsc.att.com (gregg.g.wonderly) writes: >> I find the UN*X shells' quoting conventions to be quite adequate at >> avoiding the need to require a SPACE anywhere. If you want something which >> contains meta characters to become part of a parameter-word, you quote it. > >The problem is that in this case you have two sets of metacharacters >conflicting at the shell level. Think about the following: > > list lformat=%s #?.c|#?.h | zoo ... > >Now if you quote that: > > list lformat=%s "#?.c|#?.h" | zoo ... > >How does list know whether to expand it or not? What if you're using a shell >that does expansion? A Unix shell would pipe the first example as: list lformat=%s #?.c (pipe) #?.h (pipe) zoo and the second as: list lformat=%s "#?.c|#?.h" (pipe) zoo Generally, the shell knows about the quoting metacharacter, and it takes precedence over the other metacharacters. The backslash is always a single character quote, the quotation mark is always a quotation delimiter unless preceded by a backslash, and other characters are not considered metacharacters when quoted (although I believe some metacharacters for some shells are always metacharacters unless quoted with the backslash). -- bruce@zuhause.mn.org