-->
当前位置:首页 > 题库

单选题:You are creating a script with demands that the previous command

Luz5年前 (2021-05-10)题库608
You are creating a script with demands that the previous command execute correctly. How would you correctly test the exit status of the previous command in bash? @[B](1)
A. if [ "$#" -eq "0" ]; then...
B. if [ "$?" -eq "0" ]; then...
C. if [ '$#' == 0 ]; then...
D. if [ '$?' == '0']; then...




A.if [ "$#" -eq "0" ]; then...
B.if [ "$?" -eq "0" ]; then...
C.if [ '$#' == 0 ]; then...
D.if [ '$?' == '0']; then...


答案:B