相关疑难解决方法(0)

什么语言使用"fi"

看到这个脚本,我试图找出使用的语言...它几乎像C,但我注意到fi是一种关闭嵌套if的方法.

function prompt () {
if [ "$noprompt" ] && [ "$#" = "1" ]; then
    if [ "$1" = "yes" ]; then
        echo "DEFAULT: yes"
        return 0
    else
        echo "DEFAULT: no"
        return 1
    fi
fi

while true; do
    echo "Enter \"yes\" or \"no\": "
    read response
    case $response
    in
        Y*) return 0 ;;
        y*) return 0 ;;
        N*) return 1 ;;
        n*) return 1 ;;
        *)
    esac
done
}
Run Code Online (Sandbox Code Playgroud)

shell

6
推荐指数
3
解决办法
5674
查看次数

标签 统计

shell ×1