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 FAA27755 for ; Mon, 4 Nov 1996 05:03:52 +1100 (EST) Received: (from list@localhost) by euclid.skiles.gatech.edu (8.7.3/8.7.3) id MAA08367; Sun, 3 Nov 1996 12:47:00 -0500 (EST) Resent-Date: Sun, 3 Nov 1996 12:40:35 -0500 (EST) Comments: Authenticated sender is From: "DPD" Organization: DPD To: zsh-users@math.gatech.edu Date: Sun, 3 Nov 1996 12:41:27 -0500 MIME-Version: 1.0 Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7BIT Subject: "Parse Error: Condition Expected" Priority: normal X-mailer: Pegasus Mail for Win32 (v2.31) Message-Id: <17404688102380@asan.com> Resent-Message-ID: <"9l9iU2.0.L02.JaDVo"@euclid> Resent-From: zsh-users@math.gatech.edu X-Mailing-List: archive/latest/485 X-Loop: zsh-users@math.gatech.edu X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu Hello there! (Please mail all destructive comments to /dev/null...I'll get to those later..Thanks!) Here is a portion of the entire script. This module essentially reads my /etc/group file, pulls out all users (currently domenick, sysop, root) in a particular group (sysop) and stores them in a variable for later processing. For logical purposes, the file "~/tmp/.sysop.users.group" in the following script already contains the extracted list of users from the sysop group; i.e, when 'cat'ed to the screen, this file contains data formatted as "domenick,sysop,root". This portition of the script: --------------------------------------------------------------- control="start" integer count=1 until [ $control = "stop" ] do user=`cut -d "," -f $count ~/tmp/.sysop.users.group` if [ $user = "" ] ************************** LINE #48 then # stop the loop control="stop" else if [ $user = "root" ] *************************LINE #54 then # Don't include root in the list! count=$count+1 else echo "$user " >> ~/tmp/.list.group count=$count+1 fi fi done new_list=`cat ~/tmp/.list.group` -------------------------------------------------------------------- Produces this (continous) output (which is ultimately 'kill'ed): ***************************************** ./group.zsh: parse error: condition expected: = [48] ./group.zsh: parse error: condition expected: = [54] ./group.zsh: parse error: condition expected: = [48] ./group.zsh: parse error: condition expected: = [54] ./group.zsh: parse error: condition expected: = [48] ./group.zsh: parse error: condition expected: = [54] ./group.zsh: parse error: condition expected: = [48] ./group.zsh: parse error: condition expected: = [54] ***************************************** 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) Great! Now how do I write the script to stop processing on this encounter??? Please feel free to interject your comments/ideas. One crude(?) idea which quickly comes to mind is to basically using the 'od -a' command to capture each read and then compare it to the set value of "0000000 nl"....if they match, then stop the loop... There has got to be a better way to do this..... Apparently and rightfully so, this issue is causing the 'parse error...' in both of the "if" statements within this loop...right?? BTW, I'm running zsh version 3.0.0. Thanks for all your help! Dom