bash allow only positive integer or positive integer with decimal point

后端 未结 2 1175
慢半拍i
慢半拍i 2021-01-27 21:39
price=\"1.11\"
case $price in
            \'\'|*[!0-9]*) echo \"It is not an integer.\";
            ;;
        esac

Output: It is not an integer

2条回答
提交回复
热议问题