On 5/17/06, jeff <[EMAIL PROTECTED]> wrote:
In bash:

I know that you can use [ -f file ] to check for file, but is there
something similar to check if there are any matches to a wild card?
i.e. [ -? file* ]

Not directly (as a predicate), but you could achieve it with something
along the lines of:

if [ ! -z "`ls -d file* 2> /dev/null`" ]; then
   echo "some file(s) matched"
else
   echo "no files matched"
fi

Michael

/*
PLUG: http://plug.org, #utah on irc.freenode.net
Unsubscribe: http://plug.org/mailman/options/plug
Don't fear the penguin.
*/

Reply via email to