![源 ~/.profile 中的错误](https://linux22.com/image/909800/%E6%BA%90%20~%2F.profile%20%E4%B8%AD%E7%9A%84%E9%94%99%E8%AF%AF%20.png)
~/.profile (line 25): Missing end to balance this if statement
if [ -d "$HOME/local/bin" ] ; then
^
from sourcing file ~/.profile
called on standard input
source: Error while reading file “/home/user/.profile”
答案1
根据报告的错误,您似乎正在将 Bourne 风格.profile
引入fish
shell:
$ fish
Welcome to fish, the friendly interactive shell
Type help for instructions on how to use fish
~>
~> source ~/.profile
Missing end to balance this if statement
~/.profile (line 22): if [ -r "$HOME/env_vars" ]; then
^
from sourcing file ~/.profile
called on standard input
source: Error while reading file “/home/steeldriver/.profile”
两个 shell 系列之间的条件语法不兼容:例如参见fish 教程:条件语句 (If, Else, Switch)