Oh, i see.
Another problem i have, assuming i'm using " ls !(pattern) ", is the shell i'm using.
The server is a Windows Server but have installed CYGWIN and Bash doesn't recognize the " ! ".
Is there other solution?
Regards,
osramos
Quote:
Originally Posted by jim mcnamara
What you are asking is to create a resultset that all files minus pattern1 minus pattern2
The only problem for this is that we will have to use grep -v. The file matching patterns become regular expressions
Code:
??????.xls
# becomes regex:
[0-9]{6}\.xls
This will happen for every file you want to exclude. Otherwise, you cannot just
Code:
ls !(pattern)
for five different files because each instance of !(pattern2) will show other patterns like pattern2 pattern3... etc.
Code:
# generalized solution
ls directory | grep -v -e 'regex1' -e 'regex2' -e 'regex3'
Therefore you have to construct 50 different regexes (one for each file you have to specify) and apply some of them to the correct directory output from ls. I cannot do that for you.
|