Am 08.08.2011 11:33, schrieb Francky Leyn:
> Hello,
> 
> consider the following code:
> 
> EXTENSION=jpg
> INPUT_FILES=*.$EXTENSION

echo "$INPUT_FILES" #obviously wrong
#instead maybe
INPUT_FILES="$(ls *.$EXTENSION)"

> 
> if [ -z "$INPUT_FILES" ]; then
>   echo "No .$EXTENSION input files in this directory"
>   exit -1
> fi
> 
[...]
> 
> What is wrong here?
> 
> Best regards,
> 
> Francky Leyn

I think there are even better ways to do this, but this is one that came
to my mind at the moment.

btw:

man bash | less -p 'Pathname expansion'

Reply via email to