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
    *-IGN-*) ;;
    *) # whatever you wanted on the remaining files
      ;;
  esac
done

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to