m4-discuss
[Top][All Lists]
Advanced

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

RE: Output to file


From: Dick, Brian E.
Subject: RE: Output to file
Date: Fri, 13 Aug 2004 12:13:16 -0400

Thanks. Your suggestion pointed me to another solution. I'm running m4
as a command line option to the shell. The shell provides the
redirection.

cmd /c m4 in.file >out.file

-----Original Message-----
From: Gary V. Vaughan [mailto:address@hidden 
Sent: Thursday, August 12, 2004 10:48 AM
To: Dick, Brian E.
Cc: address@hidden
Subject: Re: Output to file


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
/usr/bin/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.

HTH,
        Gary.
-- 
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




reply via email to

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