鱼壳错误

3zz*_*zzy 2 shell ubuntu fish

我安装了nvm,它在我的 中插入了一些行.profile,我修改它们以使用 Fish shell 而不是 bash:

if [ "$BASH" ]
  if [ -f ~/.bashrc ]
    . ~/.bashrc
  end
end

mesg n or true

export NVM_DIR="/root/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] and . "$NVM_DIR/nvm.sh"  # This loads nvm
Run Code Online (Sandbox Code Playgroud)

..但我仍然收到此错误:

root@server011 ~# source /root/.profile
[: the last argument must be ']'
Run Code Online (Sandbox Code Playgroud)

rid*_*ish 5

缺少分号:

[ -s "$NVM_DIR/nvm.sh" ] ; and . "$NVM_DIR/nvm.sh"
                         ^
Run Code Online (Sandbox Code Playgroud)

我不确定是否nvm.sh与鱼兼容。如果不是,鱼将无法获取它。

在这种情况下,您可以尝试fnm此插件