What's tripping you up is that some processing is being done by the
shell before grep ever sees your pattern.  Taking that into account,
what grep is seeing is:

songbird <songb...@anthive.com> writes:

> me@ant(25)$ env | grep -F "-g"
grep -F -g
> grep: invalid option -- 'g'
> Usage: grep [OPTION]... PATTERN [FILE]...
> Try 'grep --help' for more information.
> me@ant(26)$ env | grep -F '-g'
grep -F -g
> grep: invalid option -- 'g'
> Usage: grep [OPTION]... PATTERN [FILE]...
> Try 'grep --help' for more information.
> me@ant(27)$ env | grep -F 'CFL'
> CFLAGS=-g
grep -F CFL
> me@ant(28)$ env | grep '\-g'
> CFLAGS=-g
grep \-g
(I'll note that in this case you need the quotes or the shell would have
stripped the \ .  I'm guessing this one is doing what you want)
> me@ant(29)$ env | grep '-g'
grep -g
> grep: invalid option -- 'g'
> Usage: grep [OPTION]... PATTERN [FILE]...
> Try 'grep --help' for more information.
> me@ant(30)$ env | grep "-g"
grep -g
> grep: invalid option -- 'g'
> Usage: grep [OPTION]... PATTERN [FILE]...
> Try 'grep --help' for more information.
>
>
> songbird

Reply via email to