正确。这是一段代码示例:anny ~> if ! grep $USER /etc/passwd More input> then echo "your user account is not managed locally"; fi your user account is not managed locally anny > echo $? 0 anny > 来源: http://tldp.org/LDP/Bash-Beginners-Guide/html/sect_07_01.html
if...fi
块的退出状态是块内列表的退出状态,而不是条件的退出状态。 - alvits