Hi folks,
Basic question I assume.
I need to check whether a shell script variable contains non-zero numeric data to proceed. The variable should contain numeric values, but may in fact contain zeroes, blank space or nothing.
So far, I have tried various combinations of:
Code:
if test $variable
then
if test $variable -gt 0
then
echo "good data exists"
else "no good data exists"
fi
fi
It partially works, but I get either "too many arguments" or "integer expression expected"
Thanks for any help.
ijf