Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
filename expansion problem
- X-seq: zsh-users 11370
- From: "djh" <henman@xxxxxxxxxxxxxx>
- To: <zsh-users@xxxxxxxxxx>
- Subject: filename expansion problem
- Date: Tue, 03 Apr 2007 11:41:54 +0900
- Cc:
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
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