相关疑难解决方法(0)

如何否定流程的回报价值?

我正在寻找一个简单但跨平台的否定过程来否定过程返回的价值.它应该将0映射到某个值!= 0和任何值!= 0到0,即以下命令应返回"yes,nonexistingpath不存在":

 ls nonexistingpath | negate && echo "yes, nonexistingpath doesn't exist."
Run Code Online (Sandbox Code Playgroud)

的! - 运算符很棒但很遗憾不是shell独立的.

shell cross-platform negate

83
推荐指数
6
解决办法
3万
查看次数

标签 统计

cross-platform ×1

negate ×1

shell ×1