six*_*ude 2 unix bash scripting sh exitstatus
有没有更优雅的方式来做这个(bourne shell)?
IsThereAnyApplesLeft
applesLeft=$?
Run Code Online (Sandbox Code Playgroud)
通常在c或java中我会这样做:
applesLeft=IsThereAnyApplesLeft
Run Code Online (Sandbox Code Playgroud)
退出状态通常隐式使用,如下所示:
if IsThereAnyApplesLeft;then
echo "Apples left"
fi
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1383 次 |
| 最近记录: |