How to un-select files in shell wildcard patterns

Matthew Seaman matthew at
Sat Jun 22 11:45:14 UTC 2019

On 22/06/2019 00:40, Polytropon wrote:
> So, is it correct that there is no shell builtin mechanism for
> this kind of "negative selection"?

You can use a case statement like so:

for f in $filelist ; do
    case f in
       "*a*")   # Ignore files with 'a' in the name
           do something



-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 963 bytes
Desc: OpenPGP digital signature
URL: <>

More information about the freebsd-questions mailing list