[clug] Shell glob for a range of numbers?

Kim Holburn kim.holburn at anu.edu.au
Thu Jan 8 03:55:10 GMT 2004


At 10:16 AM +1000 2004/01/08, Andrew Pollock wrote:
>Hi,
>
>It's always bugged me that I can't glob a range of numbers (that I know of).
>
>I've got a bunch of files, named say argus.log.5.gz -> argus.log.21.gz
>
>I wish there was a ".." operator/regex thingy.
>
>I'd like to be able to go "cp" or something like

If
cp argus.log.{[0-9],[0-9][0-9]}.gz /tmp

doesn't work then

cp {argus.log.[0-9].gz,argus.log.[0-9][0-9].gz} /tmp
should.

>that. Unless some regex guru can show me a way of using [] expansion that I
>didn't know of...
>
>Andrew


-- 
--
Kim Holburn 
Network Consultant - Telecommunications Engineering
Research School of Information Sciences and Engineering
Australian National University - Ph: +61 2 61258620 M: +61 0417820641
Email: kim.holburn at anu.edu.au  - PGP Public Key on request

Life is complex - It has real and imaginary parts.
     Andrea Leistra (rec.arts.sf.written.Robert-jordan)


More information about the linux mailing list