【发布时间】:2019-09-07 19:17:18
【问题描述】:
假设这些功能:
return_0() {
return 0
}
return_1() {
return 1
}
然后是下面的代码:
if return_0; then
echo "we're in" # this will be displayed
fi
if return_1; then
echo "we aren't" # this won't be displayed
fi
if return_0 -a return_1; then
echo "and here we're in again" # will be displayed - Why ?
fi
为什么我要进入最后一个 ifstatement ?
我们不应该和0 和1 一样吗?
【问题讨论】:
标签: bash shell if-statement ksh