Skip to main content
added 194 characters in body
Source Link
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 wrapper 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=auto in which case the terminal escapes are only used if grep's stdout is a terminal - in other words - not in a |pipe to gcc.

Or, even better, instead of setting an inflexible shell alias with:

alias grep=grep\ --color=anything

You could take advantage of grep's $ENV setting:

GREP_COLOR=auto

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 wrapper 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=auto in which case the terminal escapes are only used if grep's stdout is a terminal - in other words - not in a |pipe to gcc.

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 wrapper 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=auto in which case the terminal escapes are only used if grep's stdout is a terminal - in other words - not in a |pipe to gcc.

Or, even better, instead of setting an inflexible shell alias with:

alias grep=grep\ --color=anything

You could take advantage of grep's $ENV setting:

GREP_COLOR=auto
deleted 1 characters in body
Source Link
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 wrapperswrapper 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=auto in which case the terminal escapes are only used if grep's stdout is a terminal - in other words - not in a |pipe to gcc.

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=auto in which case the terminal escapes are only used if grep's stdout is a terminal - in other words - not in a |pipe to gcc.

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 wrapper 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=auto in which case the terminal escapes are only used if grep's stdout is a terminal - in other words - not in a |pipe to gcc.

added 7 characters in body; added 5 characters in body; added 44 characters in body
Source Link
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--color=auto in which case the terminal escapes are only used if grep's stdout is a terminal - in other words - not in a gcc |pipe to gcc.

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.

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=auto in which case the terminal escapes are only used if grep's stdout is a terminal - in other words - not in a |pipe to gcc.

edited body; edited body
Source Link
mikeserv
  • 59.4k
  • 10
  • 122
  • 242
Loading
added 343 characters in body
Source Link
mikeserv
  • 59.4k
  • 10
  • 122
  • 242
Loading
Source Link
mikeserv
  • 59.4k
  • 10
  • 122
  • 242
Loading