如果不能工作

时间:2017-06-10 06:26:28

标签: bash shell

如果我运行此字符串,则表示错误:

if [ "$qest1" = "y"] || [ "$qest1" = "Y"]; then

有问题的行如下:

echo -e "Do you want to create a new user for the bot [Y/n]?"
echo
read qest1
echo
echo

if [[ -z "$qest1" ]]; then
    qest1="y"
fi

if [ "$qest1" = "y"] || [ "$qest1" = "Y"]; then
    echo -e "$quest Choose the username [Sinus]?"
    echo
    read user
    echo
    echo

    if [[ -z "$user" ]]; then
        user="Sinus"
    fi

    #check user
    checkuser="$(id -u $user)"
    if [[ "$checkuser" = "0" ]]; then
        echo
        echo -e "$error Change user and try again (exit)"
        echo
        pause
        exit 0
    fi

    dir="/home/$user"

else
    echo -e "$quest Choose the default directory of the bot [/opt/]?"
    echo 
    echo -e "\e[91mWARNING: The directory path at the end must have a slash (/)\e[39m"
    echo If the default directory is /opt/bot/.
    echo The bot uses the following directory:
    echo "/opt/bot/sinus1 #For bot 1"
    echo "/opt/bot/sinus2 #For bot 2"
    echo "/opt/bot/sinus3 #For bot 3"
    echo ....
    echo 
    read dir

fi

这是关于该计划的全部内容:

dataArray

你为什么要让我摆脱这个错误?我该如何解决呢。

0 个答案:

没有答案