【shell】Linux shell 之 判断用户输入的变量是否为数字

本文内容:判断用户输入的参数是否为数字 在shell中如何进行计算? 方式一 [[email protected] scripts]# echo $((1+2)) 3 方式二 [[email protected] scripts]# expr 2 + 3 5 [[email protected] scripts]# 注意:使用方式二的时候,要求必须要有间隔。如果使用的是乘法,号必须进行转义写为
相关文章
相关标签/搜索