Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: About 'test' compatibility
- X-seq: zsh-workers 16721
- From: DervishD <raul@xxxxxxxxxxxx>
- To: schaefer@xxxxxxxxxxxxxxxx
- Subject: Re: About 'test' compatibility
- Date: Tue, 26 Feb 2002 21:28:04 +0100
- Cc: zsh-workers@xxxxxxxxxx
- In-reply-to: <Pine.LNX.4.33.0202261211590.14523-100000@xxxxxxxxxxxxxxxx>
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
- Organization: ViaDomus
- References: <Pine.LNX.4.33.0202261211590.14523-100000@xxxxxxxxxxxxxxxx>
- Reply-to: DervishD <raul@xxxxxxxxxxxx>
- Sender: DervishD <raul@xxxxxxxxxxxx>
Hello Bart :))
First, thanks for your answer: *real* fast ;))
>Can you give an example of the way this is failing?
Yes, this is the line:
if [ "$DEFAULT" = "-d" -a -n "$3" ]; then
do something
else
do another thing
fi
Well, when DEFAULT is '-d' and there is a third parameter (in
this case $3 has the value 'n') the 'something' is not done. The
'another thing' is done instead :??
>Zsh 'test' does support -a for "and" but only when it appears as an
>infix operator, e.g.
Maybe the '-n' following '-a' is confusing zsh?
>which zsh would interpret as infix -a only if $foo were non-empty. The
>correct test would be
> [ "$foo" -a "$bar" ]
This is the case. Maybe I'm missing something, I'm afraid.
Thanks a lot for your answer, Bart.
Raúl
Messages sorted by:
Reverse Date,
Date,
Thread,
Author