I'm trying to validate input in ksh, and would like to know the easiest way to determine if a string is a valid number.
Have a go with :
case $INPUT in
+([0-9])*(.)*([0-9]) )
# Variable is numeric
;;
*)
# Nope, not numeric
;;
esac
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With