写一个shell脚本判断用户输入的是否是数字
#!/bin/bash
while [ true ]
do
read -p "Please input a number:" NUM
if [[ $NUM =~ ^[0-9]+$ ]];
then
echo Success
else
echo Default
fi
done
写一个shell脚本判断用户输入的是否是数字
#!/bin/bash
while [ true ]
do
read -p "Please input a number:" NUM
if [[ $NUM =~ ^[0-9]+$ ]];
then
echo Success
else
echo Default
fi
done