[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: my previous email



Does the file have any blank lines in it?  Has this question already
been answered somewhere that I'm too lazy to check? :)

--Danny

On Sat, Jul 15, 2000 at 07:22:58PM -0500, Charles Menzes wrote:
> My prior email dealt with how bash was complaining about unary statements
> being expected, or something.
> 
> like, the following:
> 
>                 while read MOVE; do
>                         NUM=`echo $MOVE | cut -f1 -d" "`
>                         if [ $NUM != $2 ] || [ -z $2 ]; then
>                         echo $MOVE >> $TMPFILE
>                         fi
>                 done < $OPENWOS
> 
> this is reading in a file $OPENWOS, line by line, and then (i hope)
> comparing the lines within the file on whether or not they are empty, or
> fi the first field is equal to $2, which will always be a number.
> 
> so, from the command line, you would have:
> 
> 	wos -c 4237
> 
> When i run the script everything occurs as it should, however I get the
> error:
> 
> ./wos: [: !=: unary operator expected
> 
> if i switch the compare operator to "$NUM -ne $2", i get:
> 
> ./wos: [: -ne: unary operator expected
> 
> 
> Can someone explain what is occurring here?
-
To unsubscribe, send email to majordomo@luci.org with
"unsubscribe luci-discuss" in the body.