rc-list - mailing list for the rc(1) shell
 help / color / mirror / Atom feed
* file globbing
@ 1992-11-03  3:54 Arnold Robbins
  0 siblings, 0 replies; only message in thread
From: Arnold Robbins @ 1992-11-03  3:54 UTC (permalink / raw)
  To: rc

>  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


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~1992-11-03  3:55 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1992-11-03  3:54 file globbing Arnold Robbins

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).