Solved [Solved] grep: unrecognized option `--exclude-dir=.cvs'

Hi everybody,

Since yesterday, I'm not able to launch a lot of command which depend on grep. The reason seems to live here:
Code:
grep: unrecognized option `--exclude-dir=.cvs'
I've tried to launch grep from differents shells and the error is still the same. Do you know what's happening?

Thank you and have a nice day.
 
wblock@ said:
grep(1) in the base system only has --exclude, not --exclude-dir. Maybe you were using GNU grep(1) instead?

Thanks for your answer but I didn't make any changes in order to use the GNU version of grep(). I don't know which tools are calling grep() with --exclude-dir. The option is not recognized whenever I'm calling:

1. portsnap fecth;
2. freebsd-update fetch;
3. Anytime I'm calling /usr/bin/grep even without the problematic option.

My shell is ZSH and I'm using Oh-my-zsh. I tried to do this http://stackoverflow.com/questions/22610707/oh-my-zsh-mac-os-x-broken but nothing has changed. I'm strongly believing did all this happen after a update of Oh-my-zsh. What do you think about this ?
 
Solved. Global variable GREP_OPTIONS was wrong

Thank you for your help. To solve the problem, I had to change part of ~/.oh-my-zsh/lib/grep.zsh:
Code:
GREP_OPTIONS+="--exclude-dir=$PATTERN "
to
Code:
GREP_OPTIONS+="--exclude=$PATTERN "
In fact, the global variable GREP_OPTIONS was wrong and so was exported with a wrong value. That's why grep() did not want to work under the other shells and under different login including root.
 
Just to confirm this, running FreeBSD 10.0-RELEASE, ZSH and oh my zsh having the same problems as above...
However the change to the oh my zsh grep lib fixed it right back up.

Thanks
 
Back
Top