From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from euclid.skiles.gatech.edu (list@euclid.skiles.gatech.edu [130.207.146.50]) by melb.werple.net.au (8.7.5/8.7.3/2) with ESMTP id DAA21840 for ; Tue, 11 Jun 1996 03:45:18 +1000 (EST) Received: (from list@localhost) by euclid.skiles.gatech.edu (8.7.3/8.7.3) id NAA26042; Mon, 10 Jun 1996 13:33:44 -0400 (EDT) Resent-Date: Mon, 10 Jun 1996 13:33:44 -0400 (EDT) From: Zoltan Hidvegi Message-Id: <199606101734.TAA06161@bolyai.cs.elte.hu> Subject: Re: [ -z $FOO ] seems broken in beta13 To: A.Main@dcs.warwick.ac.uk (Zefram) Date: Mon, 10 Jun 1996 19:34:35 +0200 (MET DST) Cc: olsenc@ichips.intel.com, zsh-workers@math.gatech.edu In-Reply-To: <7884.199606101703@stone.dcs.warwick.ac.uk> 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 X-Mailer: ELM [version 2.4ME+ PL16 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Resent-Message-ID: <"GjLRU3.0.qM6.tn5ln"@euclid> Resent-From: zsh-workers@math.gatech.edu X-Mailing-List: archive/latest/1309 X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu > >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