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" ]] && 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?
看起来您的 .bash_profile 正在由 bash 以外的 shell 执行。
"[[" .. "]]" is a bash builtin. Is another shell running the script?
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.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.