gpt4 book ai didi

shell - fish shell 错误

转载 作者:行者123 更新时间:2023-12-04 18:36:42 25 4
gpt4 key购买 nike

我安装了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

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

root@server011 ~# source /root/.profile
[: the last argument must be ']'

最佳答案

缺少分号:

[ -s "$NVM_DIR/nvm.sh" ] ; and . "$NVM_DIR/nvm.sh"
^

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

在这种情况下,您可以尝试 fnmthis plugin .

关于shell - fish shell 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41029784/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com