-3
目標是使用Bourne shell(它是作業的一部分)創建一個簡單的垃圾實用程序。我收到以下錯誤:「行17:語法錯誤:意外的文件結尾」Bash腳本「語法錯誤:文件意外結束」
我一直盯着幾個小時的代碼現在,我看不到錯誤(可能是一些簡單的我可以忽略)
#!/bin/sh
if [$# == 0] ;then
echo "Usage: trash -l | -p | { filename }*"
else
if $1 == '-l'; then
dir $HOME/.trash
else if $1=='-p'; then
rm $HOME/.trash/*
else
for i in ${} ;do
mv i $HOME/.trash
done
fi
fi
謝謝!
再添加一個網絡? –
將'else if'更改爲'elif'?祝你好運。 – shellter
@SamiKuhmonen:不。 –