I'm having trouble getting my syntax right here; I want to test the value of $1 and return true if it is between 0 and 9. I've tried many combinations including
if [ $1 -eq [0-9] ]
but none have worked when passing, say, "5" into $1.
Thanks for the reply. I think I may have done a lousy job of articulating my objective though. I'm looking to test for the presence of a non-numeric character; the above will produce an error. Perhaps that's the only way to do this, i.e. test for an error in a numeric operation?