我的问题是,下面的代码抛出这样的错误猛砸如果elif和else从句
./sync.sh: Line 25: Syntaxerror at `then [translated to english]
我的代码不会因为它应该工作在我的Linux脚本是:
#!/bin/bash
[...]
if [["$input1" == 1 && "$input2" == 1]]
then
#local herunterladen
echo "Es wird nun local herunterladen"
elif[["$input1" == 1 && "$input2" == 2]]
then
#local hochladen
echo "Es wird nun local hochgeladen"
elif [["$input1" == 2 && "$input2" == 1]]
then
#online herunterladen
echo "Es wird nun online herunterladen"
elif[["$input2" == 2 && "$input2" == 2]]
then
#online hochladen
echo "Es wird nun online hochgeladen"
else
echo "${red}Du hast einmal nicht ${green}1${red} oder ${green}2${red} gedrückt!${reset}"
fi
我的系统是用Linux作为shell的Arch Linux,但我认为这并不重要。
运行它[shellcheck](http://www.shellcheck.net/) –