What is the correct syntax for the following simple bash script test command
on (1) when using the wild card character * to match?

I have a set of files, and simply want the test to locate at least one file,
but the wild card * asterisk character seems to mess up the test command by
finding too many matches.

(1)   if test -e m* ; then echo "found" ; fi

If I write

(2) if test -e `ls m* | head -1` ; then echo "found"; fi

and don't have any files matching m*, the bash script executes, finds
nothing (as expected) but gets a success on the 'ls m* | head -1` script
execution and then echos "found"

How is the bash script written correctly so it will echo found if any m*
files exist?

Thanks

Randall
_______________________________________________
PLUG mailing list
[email protected]
http://lists.pdxlinux.org/mailman/listinfo/plug

Reply via email to