[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
my previous email
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?
thanks -cjm
-
To unsubscribe, send email to majordomo@luci.org with
"unsubscribe luci-discuss" in the body.