shell字符串判空
2016-05-23 17:48
302 查看
主要用到两个命令
-n -z
if [ -n "$PID" ]; then
echo "PID is not empty"
fi
if[ -z "$PID" ]; then
echo "PID is empty"
fi
-n -z
if [ -n "$PID" ]; then
echo "PID is not empty"
fi
if[ -z "$PID" ]; then
echo "PID is empty"
fi
相关文章推荐
- anr日志
- Shell 命令 find 的常见用法
- Linux-Shell脚本的运行方式
- Android 应用程序发送shell命令
- Shell
- 常用shell脚本
- Shell 正则表达式
- Xargs用法详解
- linux直接执行shell脚本正常,使用定时任务crontab执行出错
- crontab定期执行shell脚本
- toolbox-shell命令汇总
- shell每秒执行一次
- 2016- Shell细小问题汇总
- shell常用操作
- 如何利用Xshell远程登陆主机后使用代理服务器上网
- shell 下的运算表达
- shell把nginx执行php并且是200的状态找出来
- shell script 零碎知识
- 能提高效率的svn命令-shell 进入全屏
- shell的要点