From: arnold@cc.gatech.edu (Arnold Robbins)
To: rc@hawkwind.utcs.toronto.edu
Subject: file globbing
Date: Mon, 2 Nov 1992 22:54:12 -0500 [thread overview]
Message-ID: <9211030354.AA11141@penfold.cc.gatech.edu> (raw)
> rc has convenient ways of adding things to a list, but it has
> no particularly easy way of doing the converse, taking something
> out of one. It would be especially powerful if one could take things
> out of implicit lists, ie say 'all filenames of this pattern, except
> filenames of that pattern' conveniently.
The, ahem, Korn shell, has an extended pattern matching notation:
*(pat1|pat2|..) zero or more of pat1, pat2, ...
?(pat1|pat2|..) one or zero of pat1, pat2, ...
+(pat1|pat2|..) one or more of pat1, pat2, ...
@(pat1|pat2|..) exactly one of pat1, pat2, ...
!(pat1|pat2|..) anything that does not match pat1, pat2...
I find the most useful to be stuff like
$ ls !(*.o|core)
I don't use it a lot, mostly I suspect because it's a fairly new
feature.
Arnold
reply other threads:[~1992-11-03 3:55 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=9211030354.AA11141@penfold.cc.gatech.edu \
--to=arnold@cc.gatech.edu \
--cc=rc@hawkwind.utcs.toronto.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).