3
我試圖讓我的bash的個人資料,以激活shell啓動一個kerl實例,所以我把我的.profile如下:猛砸嵌套的if-else錯誤
if [ -d /opt/erlang/ ]; then
ERL_ENV=`ls -1d /opt/erlang/r* | sort | tail -1`;
if [ -f "$ERL_ENV/activate" ]; then
. $ERL_ENV/activate
else
echo "Couldn't activate latest erlang environment"
fi
fi
當我嘗試源文件雖然我得到這個錯誤:
-bash: .profile: line 30: syntax error near unexpected token `then'
-bash: .profile: line 30: ` if [ -f "$ERL_ENV/activate" ]; then'
我已經試過了幾種方法,但我的bash是太生疏。有什麼問題?
我使用OSX的Bash(GNU的bash,版本3.2.48(1)-release下(x86_64-蘋果darwin12))
我沒有得到任何錯誤的代碼相同的一段。我在文件中使用Fedora 16 – 2013-03-01 05:29:33
DOS回車符? – tripleee 2013-03-01 05:44:24
好主意!這導致了我真正的問題。 – 2013-03-01 06:18:06