我正在尝试运行一些简单的if / then / elif脚本,但我遇到了错误
echo $line2
If [[ $line2 == "shakespere/mid" ]] ; then
$line2 = "user/samples/mid"
mkdir /home/user/documents/mid
mkdir /home/user/documents/mid/complete
mv /user/samples/shakespere/mid/fulltext.txt /home/user/documents/mid/complete
elif [[ $line2 == "shakespere/rnj" ]] ; then
$line2 = "user/samples/rnj"
mkdir /home/user/documents/rnj
mkdir /home/user/documents/rnj/complete
mv /user/samples/shakespere/rnj/fulltext.txt /home/user/documents/rnj/complete
elif [[ $line2 == "shakespere/lll" ]] ; then
$line2 = "user/samples/lll"
mkdir /home/user/documents/lll
mkdir /home/user/documents/lll/complete
mv /user/samples/shakespere/lll/fulltext.txt /home/user/documents/lll/complete
elif [[ $line2 == "shakespere/misc ]] " ; then
$line2 = "user/samples/misc"
mkdir /home/user/documents/misc
mkdir /home/user/documents/misc/complete
mv /user/samples/shakespere/misc/fulltext.txt /home/user/documents/misc/complete
else
$line2 = "user/samples/son"
mkdir /home/user/documents/son
mkdir /home/user/documents/son/complete
mv /user/samples/shakespere/son/fulltext.txt /home/user/documents/son/complete
fi
我收到此错误:“语法错误:”然后“意外(期待”完成“)”
我确信这很简单,但它让我不知道为什么。
如果/然后发表声明,我甚至都疯了。没有好处。
在Raspbian上运行 - RPi3b的最新更新
答案 0 :(得分:0)
真的很简单..在IF中的大写情况我没有工作。 它必须是"如果"
抱歉,我的语法纳粹在写剧本时出现了。