From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: zsh-workers-request@euclid.skiles.gatech.edu Received: from euclid.skiles.gatech.edu (list@euclid.skiles.gatech.edu [130.207.146.50]) by coral.primenet.com.au (8.7.5/8.7.3) with ESMTP id GAA27864 for ; Mon, 4 Nov 1996 06:19:49 +1100 (EST) Received: (from list@localhost) by euclid.skiles.gatech.edu (8.7.3/8.7.3) id NAA09151; Sun, 3 Nov 1996 13:58:31 -0500 (EST) Resent-Date: Sun, 3 Nov 1996 13:51:09 -0500 (EST) From: "Bart Schaefer" Message-Id: <961103105447.ZM27640@candle.brasslantern.com> Date: Sun, 3 Nov 1996 10:54:47 -0800 In-Reply-To: "DPD" ""Parse Error: Condition Expected"" (Nov 3, 12:41pm) References: <17404688102380@asan.com> Reply-To: schaefer@nbn.com X-Mailer: Z-Mail (4.0b.820 20aug96) To: "DPD" , zsh-users@math.gatech.edu Subject: Re: "Parse Error: Condition Expected" MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Resent-Message-ID: <"QL2gV.0.UD2.TcEVo"@euclid> Resent-From: zsh-users@math.gatech.edu X-Mailing-List: archive/latest/486 X-Loop: zsh-users@math.gatech.edu X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu On Nov 3, 12:41pm, DPD wrote: } Subject: "Parse Error: Condition Expected" } } if [ $user = "" ] ************************** LINE #48 } if [ $user = "root" ] *************************LINE #54 Change those to if [ "$user" = "" ] if [ "$user" = "root" ] and your parse errors will go away. } After some searchin', I used the "od -a 'filename'" command to look at } the output each time the loop went through. I found that the last } read was storing an 'nl' in the variable "user" - which I hypothesized } to mean 'new line' (correct me if I'm wrong). } (BTW, the first line of the od output is: 0000000 nl) There's no "nl" stored in $user -- there's an empty string stored in it. The "nl" is an artifact of how you ran "od" as far as I can tell. } Apparently and rightfully so, this issue is causing the 'parse } error...' in both of the "if" statements within this loop...right?? What's causing the parse error is that $user is empty, so zsh sees if [ = "" ] You have to put quotes around the variable reference to turn an empty variable into an empty string for parsing purposes. -- Bart Schaefer Brass Lantern Enterprises http://www.well.com/user/barts http://www.nbn.com/people/lantern