bash – 如何判断“find”命令的输出是否为空?
发布时间:2020-12-15 18:41:32 所属栏目:安全 来源:网络整理
导读:如果输出为空,我想返回退出状态0,否则返回1. find /this/is/a/path/ -name core.* 当你说你想要返回一个特定的号码,你指的是退出状态?如果是这样: [[ -z `find /this/is/a/path/ -name core.*` ]] 而且既然你只关心一个是/否的回应,你可能想把你的发现改为
如果输出为空,我想返回退出状态0,否则返回1.
find /this/is/a/path/ -name core.*
当你说你想要返回一个特定的号码,你指的是退出状态?如果是这样:
[[ -z `find /this/is/a/path/ -name core.*` ]] 而且既然你只关心一个是/否的回应,你可能想把你的发现改为: [[ -z `find /this/is/a/path/ -name core.* -print -quit` ]] 在第一个核心文件找到后将停止.否则,如果根目录很大,则可能需要一段时间. (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
相关内容
- CXF关于Aegis的简单示例
- Angular 6 – IOS中的Chrome – 路由器问题
- 学习bootstrap做响应式网站
- angularjs – 为什么我们为Angular 2.0安装了Node.js?
- angularjs – 是否有可能使用$rootScope作为商店在Angular
- angular confing 配置
- 调用webservice时报错The request failed with HTTP status
- scala – 使用sbt native packager进行基于环境变量的运行时
- AngularJS:当调用$ scope时,防止错误$ digest已经在进行$
- docker – 如何在本地机器和minikube之间传输文件?