shell 脚本 if then else fi
来源:互联网 发布:网络舆情监测应急预案 编辑:程序博客网 时间:2024/05/10 16:19
---------------------------------------------------------------
echo "Please y to continue"
read yn
if [ "$yn" = "y" ] || [ "$yn" = "Y" ]; then
echo "script is running..."
else
echo "stop!"
fi
注意有空格哦------------------------------------------
if [ "$1" = "hello" ] ; then
echo "hello!"
elif [ "$1" = "" ]; then
echo " no parameter"
else
echo "only hello "
fi
[dev@abtsvr shellTest]$ sh test6.sh
no parameter
[dev@abtsvr shellTest]$ sh test6.sh hhh
only hello
[dev@abtsvr shellTest]$ sh test6.sh hello
hello!
----------------------------------------------------------------------------------
- shell 脚本 if then else fi
- Shell脚本语法-- if/then/elif/else/fi
- Shell脚本语法-- if/then/elif/else/fi
- Shell脚本语法-- if/then/elif/else/fi
- Shell脚本语法--if/then/elif/else/fi
- 第五章 shell 机构化脚本【if-else-fi】
- 4 Bash If Statement Examples ( If then fi, If then else fi, If elif else fi, Nested if )
- 4 Bash If Statement Examples ( If then fi, If then else fi, If elif else fi, Nested if )
- linux shell ---if...else...fi
- linux shell 编程 3(if then else fi 字符串空的判断)
- if fi shell 脚本
- shell编程:理解if-test-then-fi
- Linux-Shell脚本编程-学习-5-Shell编程-使用结构化命令-if-then-else-elif
- 让linux每天为自己建立工作目录,shell编程之if[];then...else...fi和date +Y%m%d
- shell 脚本 if elseif else
- shell 脚本 if elseif else
- shell 脚本中的if else
- shell脚本嵌套if else
- Essential Security Tools: OpenSSL and Keytool
- Domino服务器在局域网内如何收发邮件(配置自己的DOMINO服务器)?
- 办公室新来了一个mm #^_^#
- 转一愤青的言论
- 网页中添加调用qq或者msn,skype聊天窗口与客服进行互动
- shell 脚本 if then else fi
- 在linux上安装ftp服务
- 从网上看到的比较不错的介绍委托
- 运行 里面打开 记事本
- 字符集编码问题研究
- Java Content Repository
- 值得一读--多上了三五年[zz]
- shell case...esac
- VS2005(VC++)远程调试方法