Bash - 有什么用"fi ;;"?

Rog*_*ger 41 bash if-statement

我一直在寻找解释.以下是apt-fast.sh脚本的一个真实示例:

if [ ! -x /usr/bin/axel ]
then echo "axel is not installed, perform this?(y/n)"
    read ops
    case $ops in
     y) if apt-get install axel -y --force-yes
           then echo "axel installed"
        else echo "unable to install the axel. you are using sudo?" ; exit
        fi ;;
     n) echo "not possible usage apt-fast" ; exit ;;
    esac
fi
Run Code Online (Sandbox Code Playgroud)

"fi ;;"if街区中间有什么用?

Nic*_*tti 70

fi关闭if语句,同时;;关闭语句中的当前条目case.


Man*_*y D 12

fi是关闭,如果块中的y)case语句和;;用于结束的y)情况下.


glg*_*lgl 9

fi终止前面的内容if,同时;;终止前面的y)情况case...esac.


hug*_*hes 8

fi关闭if声明开了3行.;;关闭由开放的案件y).