Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
conditional expressions (incompatible with ksh)
- X-seq: zsh-users 4365
- From: lists@xxxxxxxxxxxx
- To: zsh-users@xxxxxxxxxx
- Subject: conditional expressions (incompatible with ksh)
- Date: Wed, 10 Oct 2001 12:35:40 -0500
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
Hello,
So I have a ksh script which tests to see if a file exists like so:
if [ -a file ]; then
This works correctly in both ksh and bash. However, in zsh (both the normal
mode, and the ksh compatible mode), the -a operator is only interpreted
as boolean AND, never as "file exists" in the appropriate context.
According to my "Unix in a Nutshell" book, -a is used for both operators,
and the shell needs to determine the correct use from context.
I realize that I could use [[ ]] instead of [ ] to work around this problem,
but the script needs to remain compatible with other shells, so this isn't
really a good option.
Any idea what the correct behavior should be?
mdr
--
Matthew D. Rench
Messages sorted by:
Reverse Date,
Date,
Thread,
Author