UNIX shell while [ "$yn" = "yes" -a "$yn" = "YES" ] until [ "$yn" == "yes" -a "$yn" == "YES" ]上面两句里面的 -a 和-o 和&& | 一样吗

来源:学生作业帮助网 编辑:六六作业网 时间:2024/11/16 13:07:38
UNIXshellwhile["$yn"="yes"-a"$yn"="YES"]until["$yn"=="yes"-a"$yn"=="YES"]上面两句里面的-a和-o和&&|一样吗UNIXshel

UNIX shell while [ "$yn" = "yes" -a "$yn" = "YES" ] until [ "$yn" == "yes" -a "$yn" == "YES" ]上面两句里面的 -a 和-o 和&& | 一样吗
UNIX shell while [ "$yn" = "yes" -a "$yn" = "YES" ] until [ "$yn" == "yes" -a "$yn" == "YES" ]
上面两句里面的 -a 和-o
和&& | 一样吗

UNIX shell while [ "$yn" = "yes" -a "$yn" = "YES" ] until [ "$yn" == "yes" -a "$yn" == "YES" ]上面两句里面的 -a 和-o 和&& | 一样吗
-a 表示 与 and
-o 表示 或 or
-a 和 && 一样,-o 和||一样,但&&和||需要在方括号外使用:
while [ "$yn" != "yes" ] && [ "$yn" != "YES" ]
until [ "$yn" == "yes" ] || [ "$yn" == "YES" ]