Article View: comp.sys.amiga.tech
Article #2995Re: Wildcards
From: Peter da Silva
Date: Mon, 19 Mar 1990 14:16
Date: Mon, 19 Mar 1990 14:16
41 lines
2159 bytes
2159 bytes
> Peter> In UNIX, you have to use several expressions:
> Peter> _*.[ch] _*.bak ck*.[ch] ck*.bak *test*.[ch] *test*.bak
> For csh users: {_,ck,*test}*.{[ch],bak}
> AmigaDOS's (x|y|z) syntax is directly analogous to csh's {x,y,z}.
No, it isn't. In most cases it can be used the same way, but it's not
identical.
The csh {,} syntax is parsed before wildcarding is done. It's not really
an alternation operator, like the Amiga (|) syntax supports. For example,
expanding {core,*.o} will produce the string "core" whether or not there
is a file matching that pattern. This can be useful, but it's not the same
thing. Also, as other people have pointed out, there's still no closure
operator. How about all file names of the form cx followed by any number
of digits?
cx#(0|1|2|3|4|5|6|7|8|9)
Also, of course, it's not available in scripts.
> Granted, AmigaDOS wildcards are flexible and powerful, but I find them
> less convenient to use than Unix wildcards, under most circumstances.
Which is why my original message, that started this whole chain off, suggested
using UNIX wildcards interactively and the more powerful Amiga wildcards in
scripts.
That suggestion, by the way, was that *all* uses of wildcards be marked
explicitly, and all arguments not marked as wildcards not be wildcarded.
On the Amiga, for example, anything not enclosed in parentheses would be
treated literally.
Anyway, Deven, get back to coding up Amigix & quit wasting time on News. :->
--
_--_|\ Peter da Silva <peter@sugar.hackercorp.com>.
/ \
\_.--._/ I haven't lost my mind, it's backed up on tape somewhere!
v "Have you hugged your wolf today?" `-_-'
Technical Details
Message-ID:
<5421@sugar.hackercorp.com>Path:
arc1-ca.pugleaf.net!utzoo!attcan!uunet!lll-winken!uwm.edu!wuarchive!texbell!sugar!peterReferences:
<102618@linus.UUCP> <5405@sugar.hackercorp.com> <DEVEN.90Mar19071609@netserv2.rpi.edu>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!lll-winken!uwm.edu!wuarchive!texbell!sugar!peter From: peter@sugar.hackercorp.com (Peter da Silva) Newsgroups: comp.sys.amiga.tech Subject: Re: Wildcards Message-ID: <5421@sugar.hackercorp.com> Date: 19 Mar 90 14:16:57 GMT References: <102618@linus.UUCP> <5405@sugar.hackercorp.com> <DEVEN.90Mar19071609@netserv2.rpi.edu> Reply-To: peter@sugar.hackercorp.com (Peter da Silva) Organization: Sugar Land Unix - Houston Lines: 41