I was playing around with setting
GREP_OPTIONS and couldn't get it to work. Just curious as to why.
Simple test commands output:
richard@ubuntu:~$ echo $GREP_OPTIONS richard@ubuntu:~$ richard@ubuntu:~$ ls | grep o Desktop downloads Dropbox ebooks workspace richard@ubuntu:~$ ls | grep o --color=always | less -R richard@ubuntu:~$ export GREP_OPTIONS="--color=always" richard@ubuntu:~$ ls | grep o | less -R
- The 1st grep outputs to the terminal in color (each 'o' is red)
- The 2nd grep outputs via less in color (same as 1)
- But the 3rd grep outputs to less but in black & white – but this should be in color.
So it appears that grep is ignoring
GREP_OPTIONS. Is that a bug or am I doing something wrong?
(Ubuntu 12.04.2, GNU grep 2.10)