Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: [ -z $FOO ] seems broken in beta13
- X-seq: zsh-workers 1309
- From: Zoltan Hidvegi <hzoli@xxxxxxxxxx>
- To: A.Main@xxxxxxxxxxxxxxxxx (Zefram)
- Subject: Re: [ -z $FOO ] seems broken in beta13
- Date: Mon, 10 Jun 1996 19:34:35 +0200 (MET DST)
- Cc: olsenc@xxxxxxxxxxxxxxxx, zsh-workers@xxxxxxxxxxxxxxx
- In-reply-to: <7884.199606101703@xxxxxxxxxxxxxxxxxxxxxxx> from Zefram at "Jun 10, 96 06:03:37 pm"
- Organization: Dept. of Comp. Sci., Eotvos University, Budapest, Hungary
- Phone: (36 1)2669833 ext: 2667, home phone: (36 1) 2752368
> >I use [ -z $TERM ] to check for terminal settings, and since we revved up
> >from 2.5, I'm now forced to use $+TERM.
> >
> >Now I get "argument expected". Is this correct?
>
> Yes. If $TERM is empty, then $TERM will be removed from the command
> line completely, leaving `[ -z ]`, which is a syntax error. If you use
> "$TERM" (note the quotes), then the result will be `[ -z "" ]`, which
> is legal.
Actually POSIX says that
with no arguments test should exit with status 1.
With 1 argument it should exit true iff that argument is non-null (this
means that `test -n' and `test -z' both exit true).
With 2 arguments: if $1 is a bang `!' exit true iff $2 is null. If $1 is
an unary operator, exit true iff the unary test is true.
etc.
I'll modify zsh according to this.
Zoltan
Messages sorted by:
Reverse Date,
Date,
Thread,
Author