[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

replacement for the nullglob bashism


I'm looking for a substitute for (unposixly) doing "shopt -s nullglob"
before a loop over an expansion.

Is there a good substitution?

The shortest I came up with was doing

[ "$(echo *.foo)" = "*.foo" ] || for X in *.foo ; do foo "${X}"; done

Kind regards and thanks in advance

Thomas Viehmann, <http://thomas.viehmann.net/>

Attachment: pgpvzLhiJJuwI.pgp
Description: PGP signature

Reply to: