[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 14:27:25 -0700 (PDT)

># makefile
>VARA := $(shell echo someText)
>VARB := $(shell echo $(VARA)1)
>    @echo $(VARA)2
>    @echo $(VARB)3
># end
>This prints:
>I expect it to print:

The reason for this seems to be the following...
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 can be changed easily by just echoing the 
buffered characters to stdout as they are coming in...

      if (cc <= 0)

can be changed to...

      if (cc <= 0)
        fwrite(&buffer[i], 1, cc, stdout);

in the function "func_shell"

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]