Bash-"fi ;;"的用途是什么? [英] Bash - what's the use of "fi ;;"?

查看:116
本文介绍了Bash-"fi ;;"的用途是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我到处都在寻找解释.这是取自apt-fast.sh脚本的真实示例:

I have been searching everywhere for an explanation. Here's a real example taken from the apt-fast.sh script:

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

if块中间的"fi ;;"有什么用?

推荐答案

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

fi closes the if statement, while ;; closes the current entry in the case statement.

这篇关于Bash-"fi ;;"的用途是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆