[Top][All Lists]

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

Re: Output to file

From: Gary V. Vaughan
Subject: Re: Output to file
Date: Thu, 12 Aug 2004 15:47:42 +0100
User-agent: Mozilla Thunderbird 0.7 (X11/20040615)

Hi Dick!

A wrapper script seems like the easiest way to achieve that, so instead of
running the real m4, point NAnt at a wrapper script:

$ which m4
$ cat ./m4
#! /bin/sh
exec >outputfile
/usr/bin/m4 ${1+"$@"}
$ cat ./test.m4
define(`foo', `bar')dnl
foo bar black sheep
$ m4 ./test.m4
bar bar black sheep
$ ./m4 ./test.m4
$ cat outputfile
bar bar black sheep

Dick, Brian E. wrote:
> I'm having problems running m4 from NAnt (
> _http://sourceforge.net/projects/nant/_ ). NAnt echoes all standard
> output to the console. Since m4 writes the processed text to standard
> output, the processed text spews to the console. NAnt also has problems
> with redirection, so that is not an option.
> Is there a way to get m4 to send processed text to a file and only send
> error messages to standard output?

Error messages alway go to standard error, but will end up on your console
too, which is probably what you want.

Gary V. Vaughan      ())_.  address@hidden,gnu.org}
Research Scientist   ( '/   http://tkd.kicks-ass.net
GNU Hacker           / )=   http://www.gnu.org/software/libtool
Technical Author   `(_~)_   http://sources.redhat.com/autobook

Attachment: signature.asc
Description: OpenPGP digital signature

reply via email to

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