相关疑难解决方法(0)

寻找匹配的“”时出现意外的 EOF - bash 脚本

我刚写了一个 bash 脚本,总是收到这个 EOF 错误。

所以这是我的脚本(仅适用于 OS X):

#!/bin/bash

#DEFINITIONS BEGIN
en_sq() {
    echo -e "Enabling smart quotes..."
    defaults write NSGlobalDomain NSAutomaticQuoteSubstitutionEnabled -bool true
    status=$(defaults read NSGlobalDomain NSAutomaticQuoteSubstitutionEnabled -bool)
            if [ "$status" = "1" ]
                then
                    echo -e "Success! Smart quotes are now enabled."
                    SUCCESS="TRUE"
            else
                echo -e "Sorry, an error occured. Try again."
            fi
}
di_sq() {
    echo -e "Disabling smart quotes..."
    defaults write NSGlobalDomain NSAutomaticQuoteSubstitutionEnabled -bool false
    status=$(defaults read NSGlobalDomain NSAutomaticQuoteSubstitutionEnabled -bool)
            if [ "$status" = "0" ] …
Run Code Online (Sandbox Code Playgroud)

shell bash

51
推荐指数
2
解决办法
27万
查看次数

标签 统计

bash ×1

shell ×1