#!/bin/bash
echo "-----------------strat---------------"
read -p "Enter a number:" value;
if [[ $value -le 10 ]];then
echo "Enter the number is less than 10!";
fi
在上面的代码中需要注意的问题是:
if [[ $value -le 10 ]]这段代码大括号跟变量之间需要保持空格
文章标签 bash 大括号 javascript 文章分类 PHP 后端开发
#!/bin/bash
echo "-----------------strat---------------"
read -p "Enter a number:" value;
if [[ $value -le 10 ]];then
echo "Enter the number is less than 10!";
fi
在上面的代码中需要注意的问题是:
if [[ $value -le 10 ]]这段代码大括号跟变量之间需要保持空格
写成一行(适用于终端命令提示符):末尾的fi就是if倒过来拼
shell中if条件判断数值、文件
举报文章
请选择举报类型
补充说明
0/200
上传截图
格式支持JPEG/PNG/JPG,图片不超过1.9M