首页 › 答案 › 题库 › 博览群书

在Shell变量引用操作符可实现字符串替换其中()用来测试,如果变量stra存在,则返回为变量stra的值,否则输出为word,并退出当前脚本程序

在Shell变量引用操作符可实现字符串替换其中()用来测试,如果变量stra存在,则返回为变量stra的值,否则输出为word,并退出当前脚本程序
A.${stra-word}
B.${stra=word}
C.${stra:+word}
D.${stra:?word}
正确答案:D