Name: Anonymous 2010-09-14 15:41
Okay guys, I made a naïve script to test if a number was positive/zero/negative.
And I wanted to make it more robust. How can I test if the argument provided is a valid number?
#!/bin/sh
if [ $1 -lt 0 ]
then echo "$1 is negative"
elif [ $1 -eq 0 ]
then echo "$1 is 0"
else echo "$1 is positive"
fiAnd I wanted to make it more robust. How can I test if the argument provided is a valid number?