bug-make
[Top][All Lists]
Advanced

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

Re: [Fwd: isatty function?]


From: mst
Subject: Re: [Fwd: isatty function?]
Date: Tue, 10 Sep 2002 09:27:30 +0200
User-agent: Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.1) Gecko/20020826

Thanks, Paul!
Hmm ... I see.
How about a way to call "system" without catching stdout, let stdout be copied
as is to the child process?
The return value could be the status of the command, so let's call it status

$(status command)

Evaluates the command in sub-shell and returns the exit status.

Then what I wanted would be done simply
$(status perl -e 'return (-t STDOUT)'  )

Sounds generic enough, no?
Regards,
MST


Paul D. Smith wrote:

%% mst <address@hidden> writes:

 m> It turns out that there's no easy way, now, to determine inside the
 m> makefile whether the output is to tty or now.

 m> the simple $(shell perl -e 'print 1 if (-t STDOUT)')
 m> does not work, since anything inside a shell is sending output
 m> to shell and not to tty!
 m> I ended up doing this:
 m> .PHONE: isatty.mak
 m> include isatty.mak
 m> isatty.mak:
 m>      @perl -e 'print "isatty:=",(-t STDOUT),"\n"' > $@

 m> and this works but it forces an extra evaluation of makefile
 m> and seems too complicated for a simple thing like that ...

 m> How about a nwe function $(isatty [n]) - like isatty on file n?

Hmm.  This is an extremely rare situation--I think this is the first
time anyone has asked for it.

Unfortunately I don't think this is appropriate for a new function in
GNU make: it's too rarely needed and it's _very_ system specific (what
would that function do on a VMS system, or an Amiga system?)

In the future we will be integrating a scripting language with GNU make,
to provide a much richer set of function capabilities (this is one main
reason I don't want to add too many new functions).  Hopefully that
language will have facilities for testing this.


Thanks for the request...








reply via email to

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