Bash Script Ques

David A. Bandel david
Mon May 17 11:48:11 PDT 2004


On Sun, 08 Jun 2003 16:28:05 -0500
Michael Hipp <Michael at hipp.com> wrote:

> Hello, first post (in a long time) ...
> 
> I thought to do something like:
> 
> if [ -f myfile* ]; then
>     # do something
> fi
> 

Couple of folks have given you some clues.  Here?s why the test line
fails:

for no files, you have no problem.  For one file, you have the
equivalent of:
if [ -f myfile001 ]; then

for more than one file, you have this problem:
if [ -f myfile001 myfile002 ... ]; then

the syntax with multiple files is wrong.  -f can take only one filename.
 So another operator would be needed -- or at least another way to do
this.  See other replies.

Ciao,

David A. Bandel
-- 
Focus on the dream, not the competition.
		Nemesis Racing Team motto
GPG key autoresponder:  mailto:david_key at pananix.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://mail.linux-sxs.org/pipermail/linux-users/attachments/20030608/2985144d/attachment.pgp


More information about the Linux-users mailing list