源 RVM 脚本 - “grep:无效选项 - 'p'”

Cod*_*oll 2 ruby grep rvm

每当我尝试在 Ubuntu 或其衍生产品之一上使用 RVM 时,我都会收到以下错误:

grep: invalid option -- 'p' Usage: grep [OPTION]... PATTERN [FILE]... Try 'grep --help' for more information.

我查了一下type grep,得到了 grep is /bin/grep。所以 grep 没有别名。

这是 RVM 中的已知错误吗?如果不是,还有什么可能导致这种行为?

编辑:这发生在我source ~/.bash_profile. 当我只运行 RVM 相关部分时,我已经去复制了该行为。

aus*_*ton 5

我间歇性地有完全相同的症状:

$ grep anything *
grep: invalid option -- 'p'
Usage: grep [OPTION]... PATTERN [FILE]...
Try 'grep --help' for more information.
Run Code Online (Sandbox Code Playgroud)

在我的情况下,它实际上是该目录中的一个文件,以-

$ ls ./'-'*
./-p
Run Code Online (Sandbox Code Playgroud)

我的解决方案只是删除文件:

$ rm ./"-p"
$ ls ./'-'*
ls: cannot access ./-*: No such file or directory
$ grep anything *
grep: *: No such file or directory
Run Code Online (Sandbox Code Playgroud)


Was*_*lho 1

从您的配置中删除ps='ps ...'.bashrc,或者执行unalias ps然后运行您的 RVM 命令。