【发布时间】:2014-06-01 20:08:48
【问题描述】:
我希望 stout 在以下位置返回“备用”变量的布尔值:
pmset -g | grep standby
输出,显然这里是:
standbydelay 10800
standby 0 #<--This is what I want!#
另外:
pmset -g | grep -cim1 standby
返回1,表示仅存在字符串。它没有给我任何关于它的布尔值的信息。
将 bool 值“0”打印到 stout 的语法是什么?我怀疑使用 awk 或 print 需要额外的参数,但我不知道。先感谢您。
【问题讨论】:
标签: bash unix awk grep boolean