mirage
11-16-02, 06:11
| I am trying to read a variable read $2 how can I check whether the entered string is a number? Thanks. |
View Full Version : Numeric check
| I am trying to read a variable read $2 how can I check whether the entered string is a number? Thanks. |
| Here is another way to do it. This way will check decimals as well as whole numbers. let TST=$1*1 && print $1 numeric || print $1 non-numeric 2>/dev/null |