Globbing in csh

Randal L. Schwartz merlyn at iwarp.intel.com
Thu Feb 14 17:37:13 AEST 1991


In article <857 at caslon.cs.arizona.edu>, armstron at cs (Jim Armstrong) writes:
| Is is possible to match a group of files in alphabetic order using
| globbing in csh?  For example my dir looks like this:
| 	able	david	greedy	jolly  .....
| 	baker   emery   handy	kape   .....
| 	cain	frank	intro	lemma  .....
| 
| I want to cat all files > george (lexicographically).
| 
| Maybe something like [g-z]* but that only looks at the first
| letter and allows something like gary.
| 
| Can anyone help me please?

Hmm.  Not in csh.  But with a little assist from Perl:

cat `ls | perl -ne 'print if $_ gt "george"'`

Or, doing it all in Perl (catting and everything):

perl -e '@ARGV = grep($_ gt "george",<*>); while (<>) {	print; }'

Just another Perl hacker,
-- 
/=Randal L. Schwartz, Stonehenge Consulting Services (503)777-0095 ==========\
| on contract to Intel's iWarp project, Beaverton, Oregon, USA, Sol III      |
| merlyn at iwarp.intel.com ...!any-MX-mailer-like-uunet!iwarp.intel.com!merlyn |
\=Cute Quote: "Intel: putting the 'backward' in 'backward compatible'..."====/



More information about the Comp.unix.questions mailing list