make-w32
[Top][All Lists]
Advanced

[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)
>all:
>    @echo $(VARA)2
>    @echo $(VARB)3
># end
>
>This prints:
>someText2
>someText13
>
>I expect it to print:
>someText
>someText1
>someText2
>someText13

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)
        break;

can be changed to...

      if (cc <= 0)
        break;
      else
        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 
http://mail.yahoo.com 




reply via email to

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