
Мне пришлось задать путь в .bashrc
. Я открыл его с помощью vi .bashrc
и по ошибке пропустил последнюю строку (содержащую что-то с fi
), а затем добавил путь. Я сохранил его с помощью :wq
. Пока я source .bashrc
это делаю, отображается:
bash: .bashrc: line 148: syntax error: unexpected end of file.
Вот последние строки ~/.bashrc
:
if [ -f ~/.bash_aliases ]; then
. ~/.bash_aliases
fi
# enable programmable completion features (you don't need to enable
# this, if it's already enabled in /etc/bash.bashrc and /etc/profile
# sources /etc/bash.bashrc).
if ! shopt -oq posix; then
if [ -f /usr/share/bash-completion/bash_completion ]; then
. /usr/share/bash-completion/bash_completion
elif [ -f /etc/bash_completion ]; then
. /etc/bash_completion
fi
PATH=$PATH:/home/rbh/PROGRAMS.330/bin
export PATH
решение1
Вы .bashrc
должны выглядеть примерно так
# enable programmable completion features (you don't need to enable
# this, if it's already enabled in /etc/bash.bashrc and /etc/profile
# sources /etc/bash.bashrc).
if ! shopt -oq posix; then
if [ -f /usr/share/bash-completion/bash_completion ]; then
. /usr/share/bash-completion/bash_completion
elif [ -f /etc/bash_completion ]; then
. /etc/bash_completion
fi
fi
PATH=$PATH:/home/rbh/PROGRAMS.330/bin export PATH
Вы удалили последний fi
, который закрывал условие блока if