Bash profile syntax error: unexpected end of file

Bash profile syntax error: unexpected end of file

在我启动 tmux 时获取 -bash: ~/.profile: syntax error: unexpected end of file,但在启动终端时却没有。已尝试 运行 dos2unix,但无法解决问题。请帮助

这是我的 ~/.profile 文件。

# if running bash
if [ -n "$BASH_VERSION" ]; then
    # include .bashrc if it exists
    if [ -f "$HOME/.bashrc" ]; then
    . "$HOME/.bashrc"
    fi
fi

# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/bin" ] ; then
    PATH="$HOME/bin:$PATH";
fi

# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/.local/bin" ] ; then
    PATH="$HOME/.local/bin:$PATH";
fi

我注意到在你的 .bashrc 中有 "alias fi",if-fi 是关键字,可能会造成麻烦...尝试在 .bashrc 中对其进行注释。小费。