Skip to main content
3 of 6
edited body; edited body
mikeserv
  • 59.4k
  • 10
  • 122
  • 242

This is no good:

PATH: /usr/local/rvm/gems/ruby-1.9.3-p194/bin:\
    /usr/local/rvm/gems/ruby-1.9.3-p194@global/bin:\
    /usr/local/rvm/rubies/ruby-1.9.3-p194/bin:\
    /usr/local/rvm/bin:\
    /usr/local/sbin:\
    /usr/local/bin:\
    /usr/sbin:\
    /usr/bin:\
    /sbin:\
    /bin

I am willing to bet that in at least a few of those directories you had $PATHed ahead of /bin and /sbin - especially the ruby ones - you had common shell app wrappers scripts for colorizing output. Maybe you even had similar configuration applied in /etc/skel in which case not even /bin/env -i grep could have saved you from yourself.

This is why people compile in chroot.

P.S. I'm only so critical because I had to learn the same lesson the same way a couple years back. You probably would not have needed the =never if your $PATH was clean. Also, you can just use --color in which case the terminal escapes are only used if grep's stdout is a terminal - in other words - not in a gcc |pipe.

mikeserv
  • 59.4k
  • 10
  • 122
  • 242