[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: How to create bash-pattern to exclude a matching param in param expa
Re: How to create bash-pattern to exclude a matching param in param expansion&matching?
Mon, 28 Oct 2013 16:41:11 -0600
Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.0
On 10/28/2013 04:35 PM, Linda Walsh wrote:
> I am missing how to create a bash-pattern that excludes a specific pattern.
> I.e. to ignore any file with '-IGN-' somewhere in the filename.
> The best I've come up with so far has been to use shell to build
> a pattern, but I know it is limited in functionality. I.e.:
> ls !($(echo *+(-IGN-)*|tr " " "|"))
for $var in *; do
case $var in
*) # whatever you wanted on the remaining files
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
Description: OpenPGP digital signature