Any time if you get the following error means the
"if" statement has string (with spaces)
"The if statement gives error [: too many arguments"
Example:
a="hi hw are you"
if [ -n $a ] ;then <--- will give error
echo blah
else
echo blah
fi
Put in double quotes
a="hi hw are you"
if [ -n "$a" ] ;then <--- works fine
echo blah
else
echo blah
fi
Last edited by kpraveen455; 03-18-2009 at 09:29 AM.
|