[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: $(shell ...) and SHELL problems in 3.81

From: Aaron Shatters
Subject: Re: $(shell ...) and SHELL problems in 3.81
Date: Mon, 16 Apr 2007 17:29:11 -0700 (PDT)

>> On windows, for the $(shell ...) function, stdout for the child
>> process that executes the shell command line is piped to a stream that
>> is read from the parent process.  After the parent process reads the
>> stream into a buffer, it doesn't print it to stdout... it just puts
>> the results into the variable buffer.
>> I think that this is a problem.
>It is NOT a problem; this is exactly what the shell function is supposed
>to do.  The stdout of the command invoked is used as the expanded value
>of the shell function.  No part of stdout is actually printed to stdout.
>The shell function is essentially a make implementation of the POSIX
>shell `` (backticks) function.

Of course, you are right... this is not a problem.  The example that I had 
lifted from another makefile had stdout redirected to stderr after the echo 
command, therefore, it printed to the screen.  I failed to include this portion 
in my testing.

It was:
GARBAGE := $(shell echo text to print 1>&2)

I omitted the "1>&2", which lead to the difference in operation.

Sorry for wasting all of your time.  I should have been more thorough before 

Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 

reply via email to

[Prev in Thread] Current Thread [Next in Thread]