shell常用判断语句
2013-09-11 09:37
211 查看
1.判断文件夹是否存在
if [ ! -d "$myPath"]; then
2.判断文件是否存在
if [ ! -f /tmp/dns.out ] ; then
3.判断字符串是否为空
if [ -z "$pid" ] ; then
4.判断变量值
if [ $# -ne 1 ] ; then
5. 判断$myPath是否存在并且是否具有可执行权限
if [ ! -x "$myPath"]; then
if [ ! -d "$myPath"]; then
2.判断文件是否存在
if [ ! -f /tmp/dns.out ] ; then
3.判断字符串是否为空
if [ -z "$pid" ] ; then
4.判断变量值
if [ $# -ne 1 ] ; then
5. 判断$myPath是否存在并且是否具有可执行权限
if [ ! -x "$myPath"]; then
相关文章推荐
- Shell脚本常用语句
- Shell 中判断条件的使用(本文只列出并常用的)
- Shell变量,判断和控制语句
- shell脚本编程中条件判断语句中各个参数的含义
- 自己常用语句 获取重复数据 判断库中有这个表吗
- shell条件判断 条件为何值时判断语句为真
- shell的一些常用的语句(if语句,变量,for、while、until语句、函数调用、脚本调用)
- Shell脚本常用判断
- shell if语句判断选项
- Sql Server2008 常用判断语句(一)
- shell基础及流程控制语句之一case判断
- shell 常用语句
- shell趣味编程:case语句判断字符串内容
- shell 编程 判断语句参数
- Shell 中常用的条件判断
- shell 判断语句
- Shell判断语句初学
- shell 判断语句
- shell中常用系统变量和条件判断
- shell 判断语句