PDA

View Full Version : fstat | grep internet | grep -v -e '>' -e '<'


mfaridi
06-10-2008, 02:43 PM
When I type this command fstat | grep internet | grep -v -e '>' -e '<'

I see this error

grep: unknown option -- color
usage: grep [-abcEFGHhIiLlnoPqRSsUVvwxZ] [-A num] [-B num] [-C[num]]
[-e pattern] [-f file] [--binary-files=value] [--context[=num]]
[--line-buffered] [pattern] [file ...]
grep: unknown option -- color
usage: grep [-abcEFGHhIiLlnoPqRSsUVvwxZ] [-A num] [-B num] [-C[num]]
[-e pattern] [-f file] [--binary-files=value] [--context[=num]]
[--line-buffered] [pattern] [file ...]

halber_mensch
06-10-2008, 03:36 PM
alias grep ?
my guess is you're using a .profile/.cshrc from a system that has an alias for grep (grep --color=auto)that expects gnu grep, but OpenBSD grep does not support the gnu --color argument.

BSDfan666
06-10-2008, 03:51 PM
halber_mensch is correct, your environment seems to be appending a --color argument to grep.

BSD grep != GNU grep.

mfaridi
06-10-2008, 05:52 PM
Thanks Guys,
I check my .zshrc and I modify it and right now everything is ok

TerryP
06-10-2008, 10:58 PM
If you find yourself using different systems often, you might adjust your zshrc to change the aliases based on the OS.