zsh-users
 help / color / mirror / code / Atom feed
* [[ -f ]] and filename generation
@ 2016-04-16 11:31 Meino.Cramer
  2016-04-16 14:55 ` Eric Cook
  2016-04-16 17:10 ` Bart Schaefer
  0 siblings, 2 replies; 3+ messages in thread
From: Meino.Cramer @ 2016-04-16 11:31 UTC (permalink / raw)
  To: zsh-users

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






^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-04-16 17:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-04-16 11:31 [[ -f ]] and filename generation Meino.Cramer
2016-04-16 14:55 ` Eric Cook
2016-04-16 17:10 ` Bart Schaefer

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).