开发者

[[: Command not found

开发者 https://www.devze.com 2023-02-07 20:52 出处:网络
I\'m installing RVM on a system where I don\'t have sudo permissions. It should work fine in theory, but when I added

I'm installing RVM on a system where I don't have sudo permissions. It should work fine in theory, but when I added

[[ -s "$HOME/.rvm/scripts/rvm" ]] &&开发者_如何学Camp; source "$HOME/.rvm/scripts/rvm"

to bash_profile, it isn't doing what it's supposed to and it gives me this error

[[: Command not found.

Anyone know what might be the problem?


"[[" .. "]]" is a bash builtin. Is another shell running the script?


It looks like your .bash_profile is being executed by a shell other than bash.


Put the following at the top of your script:

#!/bin/bash

This will enforce bash to be the interpreting shell. As mentioned in other answers, [[ ]] is a bashism and not POSIX syntax.


RVM is not (yet) compatible with csh, only bash and zsh >= 4.3.5 are supported.

(see http://rvm.io/rvm/prerequisites/)

0

精彩评论

暂无评论...
验证码 换一张
取 消