ITPub博客

首页 > Linux操作系统 > Linux操作系统 > if 判断语句

if 判断语句

原创 Linux操作系统 作者:ashleywzl 时间:2012-05-10 22:21:49 0 删除 编辑

#! /usr/bin/bash
read num;
if [ $num -eq "100" ];
then
echo "num=100"
echo "xxx"
else
echo "num!=100"
fi

=----'-eq', >----'-gt',<---'-lt',>=---'ge',<=---'le',

[ -f  "somefile" ] :判断是否文件exist

note:the space in the []

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/25676270/viewspace-723289/ ,如需转载,请注明出处,否则将追究法律责任。

上一篇: 9.1 parameter file
请登录后发表评论 登录
全部评论

注册时间:2011-04-11

  • 博文量
    65
  • 访问量
    62762