How do I check for the existence of a file using a template in the Bourne shell?
What I'm looking for is something like:
if [ -f "filenam*" ]; then
...
fi
But the (*) pattern is causing problems.
I've also tried:
if [ `ls filenam* > /dev/null 2>&1` ]; then
...
fi
Which might work in other shells, but doesn't seem to work in the Bourne (sh) shell.
Thanks for any help!
EDIT: Sorry, but not the C shell, the Bourne (sh) shell.
+2
Joey joe joe
source
to share