Just annotations of little "how to's", so I know I can find how to do something I've already done when I need to do it again, in case I don't remember anymore, which is not unlikely. Hopefully they can be useful to others, but I can't guarantee that it will work, or that it won't even make things worse.
|
Posted 02-19-2014 at 03:00 PM by the dsc (linux-related notes)
Quote:
Originally Posted by cfajohnson
Quote:
i am trying to compare a value with value 50. but i am getting
"[: -lt: unary operator expected"
I am using
if [ $j -lt 50 ]
then
echo "------------"
fi
Make sure that $j expands to a value. Best is to set it explicitly, but you can also give it a default value (0 in this example):
Code:
if [ ${j:-0} -lt 50 ]
http://www.unix.com/302295072-post3.html...
|
Member
|
|
Views 1534
Comments 0
|