Whenever I try to use RVM on Ubuntu or one of it's derivatives, I get the following error:
grep: invalid option -- 'p'
Usage: grep [OPTION]... PATTERN [FILE]...
Try 'grep --help' for more information.
I checked type grep, and got
grep is /bin/grep.
So grep is not aliased.
Is this a known bug in RVM? If not, what else could be causing this behavior?
EDIT: This occurs when I source ~/.bash_profile. I've gone and reproduced the behavior when I run just the RVM related part.
I had exactly the same symptom intermittently:
$ grep anything *
grep: invalid option -- 'p'
Usage: grep [OPTION]... PATTERN [FILE]...
Try 'grep --help' for more information.
In my case it was actually a file in that directory starting with -:
$ ls ./'-'*
./-p
The solution for me was just to remove the file:
$ rm ./"-p"
$ ls ./'-'*
ls: cannot access ./-*: No such file or directory
$ grep anything *
grep: *: No such file or directory
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With