im trying to do a Number Check not including decimals as well as within range check but it is not working
example of accepted numbers: 1, 10, 100
not accepted numbers: 1.1, 10.1, 100.1
echo "Qty Sold: "
read sold
if [[ "$sold" =~ `^([0-9])$` && "$sold" -gt 0 && "$sold" -lt 999 ]] ;
then
echo "ok"
else
echo "Error, Qty Sold Must be Positive Integer";
fi