🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.amiga.tech
Article #6466

Re: PIPEs

#6466
From: Bruce Albrecht
Date: Thu, 08 Nov 1990 02:04
32 lines
1838 bytes
>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	   
Technical Details
Message-ID: <bruce.4292@zuhause.MN.ORG>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!hellgate.utah.edu!dog.ee.lbl.gov!nosc!crash!orbit!zuhause!bruce
References: <1990Nov4.072423.408@agate.berkeley.edu> <1990Nov4.150403.28982@cbnewsc.att.com> <6990@sugar.hackercorp.com>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!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: <bruce.4292@zuhause.MN.ORG>
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