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

filename expansion problem



I am having trouble either getting (1) wildcards to expan withing the conditional operation [[ ]] or (2) the conditional operator doesn't understand wildcards, or some like problem.

Explanation:
----------------
Filename expansion within the conditional operator(s) [[ ]]
zsh version: zsh 4.3.2 (i686-pc-cygwin)

My example:  (I created an file with an arbitrary filename and tried to test for its existence using -3) Below are the results: Notice that echo works fine.
----------------
$ touch file-name-20070312.tar.bz2
$ echo  file-name-*.tar.bz2
file-name-20070312.tar.bz2
$ if [[ -e file-name-*.tar.bz2 ]] ; then print hello ; fi
$
$ if [[ -e file-name-20070312.tar.bz2 ]] ; then print hello ; fi
hello
$

What is the trick to enable me to use wild cards withing the conditional [[ ]]

Thanks,
  D. Henman



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