会员
周边
捐助
新闻
博问
闪存
赞助商
所有博客
当前博客
我的博客
我的园子
账号设置
简洁模式
...
退出登录
注册
登录
陌鉎こ城sHi
博客园
首页
新随笔
联系
订阅
管理
2021年3月9日
Bash中判断一个命令的输出结果是否为空
摘要: 如果我们想在Bash中判断一个命令的输出结果是否为空,我们可以使用test命令和-z参数。示例代码如下: if test -z "$(ls | grep test1.txt)"; then echo "The result is empty." else echo "The result is no
阅读全文
posted @ 2021-03-09 17:26 陌鉎こ城sHi
阅读(2904)
评论(0)
推荐(0)
编辑