Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
[[ -f ]] and filename generation
- X-seq: zsh-users 21449
- From: Meino.Cramer@xxxxxx
- To: zsh-users@xxxxxxx
- Subject: [[ -f ]] and filename generation
- Date: Sat, 16 Apr 2016 13:31:33 +0200
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
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