Oct 26, 2004 #1 Calator Programmer Feb 12, 2001 262 AU Hi, in a ksh script need to test if argument passed on command line is numeric (integer). Thanks.
Oct 26, 2004 #2 KenCunningham Technical User Mar 20, 2001 8,475 GB What have you got so far? Upvote 0 Downvote
Oct 26, 2004 #3 PHV MIS Nov 8, 2002 53,708 FR In the ksh man page take a look at the typeset builtin (-i). Hope This Helps, PH. Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244 Upvote 0 Downvote
In the ksh man page take a look at the typeset builtin (-i). Hope This Helps, PH. Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
Oct 26, 2004 1 #4 olded Programmer Oct 27, 1998 1,065 US For the korn shell: function is_integer { [[ $1 = ?([+-])+([0-9]) ]] } is_integer $i && echo "yes" || echo "no" Upvote 0 Downvote
For the korn shell: function is_integer { [[ $1 = ?([+-])+([0-9]) ]] } is_integer $i && echo "yes" || echo "no"