mikeym
July 21st, 2006, 03:33 PM
Hi
I have been trying to do this for a couple of days now with no sucess. I want to select a list of files by their file extension - ignoring their case - in a BASH script.
I want to select all the par2 files of the form
abc.Par2
def.PAR2
ghi.par2
jkl.paR2
mno.pAr2
pqr.PaR2
But not files such as,
abc.VOL00+001.PAR2
I thought the following should work but I can't use the ignore-case switch at the same time as the print or delete commands:
PARLIST=$(ls *.* | sed -n -e '/.vol[[:digit:]]\++[[:digit:]]\+.par2$/di' -e '/.par2$/pi')
I have been trying to do this for a couple of days now with no sucess. I want to select a list of files by their file extension - ignoring their case - in a BASH script.
I want to select all the par2 files of the form
abc.Par2
def.PAR2
ghi.par2
jkl.paR2
mno.pAr2
pqr.PaR2
But not files such as,
abc.VOL00+001.PAR2
I thought the following should work but I can't use the ignore-case switch at the same time as the print or delete commands:
PARLIST=$(ls *.* | sed -n -e '/.vol[[:digit:]]\++[[:digit:]]\+.par2$/di' -e '/.par2$/pi')