On Sat, Aug 19, 2017 at 05:30:34PM -0700, L A Walsh wrote: > Curious, but how difficult or problematic would it be > to allow using brace-expansion (ex. {f,x} ) as a short-hand > to test/combine file-op tests like: > > Allowing: > > test -{f,x} /bin/ls && ... > or > if [[ -{f,x} $file ]]; then ... ; fi > > instead of: > > test -f /bin/ls && test -x /bin/ls && ...
You could write your own helper functions for this: -fx() { test -f "$1" && test -x "$1"; } if -fx /bin/ls; then ...; fi