Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

[[ -f ]] and filename generation



Hi,

A script I am writing is reading filenames from a list.
These filenames not complete.

Example:

On disk:
filename.ext1.ext2

In the list:
filename
or
filename.ext

I want to check for the existing of the files in the list on disk with
a construct like this

if [[ -f $FILEFROMLIST ]] ; then

    # do something more useful here

fi

I know, that are different approaches to this problem (for example
reading the filenames from disk into an array and process those) but
I am interested in getting this -f thingy to run.

I tried variation of
if [[ -f "$FILEFROMLIST*" ]] ; then .... fi
with extendedglob set...but with no success.

Is there any way to get this "-f" thingy to work?

Thank you very much in advance for any help!
Best regards,
Meino







Messages sorted by: Reverse Date, Date, Thread, Author