Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/bash/17.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Bash 如果shell脚本中的条件失败,如何返回相同的if语句_Bash_Shell_If Statement - Fatal编程技术网

Bash 如果shell脚本中的条件失败,如何返回相同的if语句

Bash 如果shell脚本中的条件失败,如何返回相同的if语句,bash,shell,if-statement,Bash,Shell,If Statement,除非满足上述条件,否则是否可以将脚本保持在“if语句”状态 echo "enter the ID" <----------------Point A read var if [ "$var" == "55" ];then <------------Point B echo "good" fi echo“输入ID”A,而条件与中断可使其: while true; do echo "enter the ID" read var

除非满足上述条件,否则是否可以将脚本保持在“if语句”状态

echo "enter the ID"  <----------------Point A 

read var 

if [ "$var" == "55" ];then  <------------Point B 
echo "good" 

fi 

echo“输入ID”A
,而
条件与
中断
可使其:

while true;
do
        echo "enter the ID"
        read var 

        if [ "$var" = "55" ];then
           echo "good" 
           break
        fi 
done

while
条件和
中断
会导致:

while true;
do
        echo "enter the ID"
        read var 

        if [ "$var" = "55" ];then
           echo "good" 
           break
        fi 
done

while
条件和
中断
会导致:

while true;
do
        echo "enter the ID"
        read var 

        if [ "$var" = "55" ];then
           echo "good" 
           break
        fi 
done

while
条件和
中断
会导致:

while true;
do
        echo "enter the ID"
        read var 

        if [ "$var" = "55" ];then
           echo "good" 
           break
        fi 
done

正是我在这里所需要的,感谢我在这里所需要的,感谢我在这里所需要的,感谢我在这里所需要的,谢谢