Recently I‘m using OSX mountain lion. when I use Terminal.app, I found that my grep can not work again.
no mater what I do, the grep always report a warning:
$ grep --version
*usage: grep [-abcDEFGHhIiJLlmnOoPqRSsUVvwxZ] [-A num] [-B num] [-C[num]]
[-e pattern] [-f file] [--binary-files=value] [--color=when]
[--context[=num]] [--directories=action] [--label] [--line-buffered]
[--null] [pattern] [file ...]*
My grep is locate at /usr/bin/:
$ ls -lh /usr/bin/grep
*-rwxr-xr-x 3 root wheel 29K Jul 26 22:52 /usr/bin/grep*
I am not sure IS this grep too small, it’s only 29K.
Do you have
GREP_OPTIONSset (to something invalid) ? Typingenvwill dump your environment variables and you can look through these to find it (I’d normally usegrep, but…)