public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-user] linux make modules solved
@ 2006-06-16  0:59 Justin R Findlay
  2006-06-16 11:50 ` Daniel Drake
  0 siblings, 1 reply; 6+ messages in thread
From: Justin R Findlay @ 2006-06-16  0:59 UTC (permalink / raw
  To: gentoo-user

I finally figured out why linux wouldn't build its modules.  Although I
learned a lot about make it was because I had set

GREP_OPTIONS="--color=always"

in my /root/.bashrc which is sourced by shell invocations from make (and
odd shell scripts as well, like configure scripts).  So, the lesson is,
don't modify common shell utilities in ~/.bashrc or strange things might
happen.  There are a couple of safe alternatives for grep colors.  You
can move GREP_OPTIONS to ~/.bash_profile which is only sourced by login
shells, or you can define

alias cgrep="--color=always"

In keeping with the shell color theme I have also defined:

alias less="less -R"
alias tree="tree -C"


Justin
-- 
gentoo-user@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [gentoo-user] linux make modules solved
  2006-06-16  0:59 [gentoo-user] linux make modules solved Justin R Findlay
@ 2006-06-16 11:50 ` Daniel Drake
  2006-06-17 10:15   ` Mick
  0 siblings, 1 reply; 6+ messages in thread
From: Daniel Drake @ 2006-06-16 11:50 UTC (permalink / raw
  To: gentoo-user

Justin R Findlay wrote:
> I finally figured out why linux wouldn't build its modules.  Although I
> learned a lot about make it was because I had set
> 
> GREP_OPTIONS="--color=always"

Using "--color=auto" would have circumvented this problem and still 
given you pretty colours when you run grep from the console.

Daniel

-- 
gentoo-user@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [gentoo-user] linux make modules solved
  2006-06-16 11:50 ` Daniel Drake
@ 2006-06-17 10:15   ` Mick
  2006-06-17 11:48     ` Etaoin Shrdlu
  0 siblings, 1 reply; 6+ messages in thread
From: Mick @ 2006-06-17 10:15 UTC (permalink / raw
  To: gentoo-user

On 16/06/06, Daniel Drake <dsd@gentoo.org> wrote:
> Justin R Findlay wrote:
> > I finally figured out why linux wouldn't build its modules.  Although I
> > learned a lot about make it was because I had set
> >
> > GREP_OPTIONS="--color=always"
>
> Using "--color=auto" would have circumvented this problem and still
> given you pretty colours when you run grep from the console.

I am getting confused here:  why is module building related to setting
grep's colour option?
-- 
Regards,
Mick
-- 
gentoo-user@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [gentoo-user] linux make modules solved
  2006-06-17 11:48     ` Etaoin Shrdlu
@ 2006-06-17 11:36       ` Bo Ørsted Andresen
  2006-06-17 11:38       ` Mick
  1 sibling, 0 replies; 6+ messages in thread
From: Bo Ørsted Andresen @ 2006-06-17 11:36 UTC (permalink / raw
  To: gentoo-user

[-- Attachment #1: Type: text/plain, Size: 543 bytes --]

On Saturday 17 June 2006 13:48, Etaoin Shrdlu wrote:
> Using --color=auto, on the
> other hand, is the correct way to do the "right" thing, ie grep
> itself "knows" whether it should emit escape sequences to colorize the
> output (if it's really outputting to terminal) or not (if, for example,
> it's called from inside a command substitution).

Just to show you the purpose of adding --color=always. Try the following:

# echo hello | grep --color=auto ll | less

# echo hello | grep --color=always ll | less

-- 
Bo Andresen

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [gentoo-user] linux make modules solved
  2006-06-17 11:48     ` Etaoin Shrdlu
  2006-06-17 11:36       ` Bo Ørsted Andresen
@ 2006-06-17 11:38       ` Mick
  1 sibling, 0 replies; 6+ messages in thread
From: Mick @ 2006-06-17 11:38 UTC (permalink / raw
  To: gentoo-user

On 17/06/06, Etaoin Shrdlu <shrdlu@unlimitedmail.org> wrote:
> On Saturday 17 June 2006 12:15, Mick wrote:
>
> > I am getting confused here:  why is module building related to setting
> > grep's colour option?
>
> There is probably some script that parses the output of grep, and,
> with --color=always, this includes terminal control characters and
> escape sequences which confuse the parser. Using --color=auto, on the
> other hand, is the correct way to do the "right" thing, ie grep
> itself "knows" whether it should emit escape sequences to colorize the
> output (if it's really outputting to terminal) or not (if, for example,
> it's called from inside a command substitution).
>
> The following works:
> echo "hello" | grep ello | grep hello
>
>
> The following does not work, since the output of the first grep
> contains "garbage" (from the point of view of the second grep) between
> the "h" and the "e":
>
> echo "hello" | grep --color=always ello | grep hello   # does not work
>
>
> Finally, the next one works, because the first grep knows that colorizing
> the output here is useless and does not emit escape sequences:
>
> echo "hello" | grep --color=auto ello | grep hello     # works

Thanks!  Nice explanation.
-- 
Regards,
Mick
-- 
gentoo-user@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [gentoo-user] linux make modules solved
  2006-06-17 10:15   ` Mick
@ 2006-06-17 11:48     ` Etaoin Shrdlu
  2006-06-17 11:36       ` Bo Ørsted Andresen
  2006-06-17 11:38       ` Mick
  0 siblings, 2 replies; 6+ messages in thread
From: Etaoin Shrdlu @ 2006-06-17 11:48 UTC (permalink / raw
  To: gentoo-user

On Saturday 17 June 2006 12:15, Mick wrote:

> I am getting confused here:  why is module building related to setting
> grep's colour option?

There is probably some script that parses the output of grep, and, 
with --color=always, this includes terminal control characters and 
escape sequences which confuse the parser. Using --color=auto, on the 
other hand, is the correct way to do the "right" thing, ie grep 
itself "knows" whether it should emit escape sequences to colorize the 
output (if it's really outputting to terminal) or not (if, for example, 
it's called from inside a command substitution).

The following works:
echo "hello" | grep ello | grep hello


The following does not work, since the output of the first grep 
contains "garbage" (from the point of view of the second grep) between 
the "h" and the "e":

echo "hello" | grep --color=always ello | grep hello   # does not work


Finally, the next one works, because the first grep knows that colorizing 
the output here is useless and does not emit escape sequences:

echo "hello" | grep --color=auto ello | grep hello     # works

HTH
-- 
gentoo-user@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2006-06-17 11:53 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-06-16  0:59 [gentoo-user] linux make modules solved Justin R Findlay
2006-06-16 11:50 ` Daniel Drake
2006-06-17 10:15   ` Mick
2006-06-17 11:48     ` Etaoin Shrdlu
2006-06-17 11:36       ` Bo Ørsted Andresen
2006-06-17 11:38       ` Mick

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox