One approach is to use a regular expression, like so: re='^[0-9]+$' if ! [[ $yournumber =~ $re ]] ; then echo "error: Not a number" >&2; exit 1 fi.
確定! 回上一頁