[Cc:ing m4-discuss]

Yiyi Hu wrote:
Sorry to disturb you.

No problem.  Please post such questions to the list in future
though, where they may serve future users.

I ever wish to try to make a .m4 file into a cgi,
But the problem is,
If you chmod the .m4 file into executable,
It will print the shebang-line

[EMAIL PROTECTED]:~/tmp$ cat asdf.m4
#!/usr/bin/m4
define(`foo', ``foo' here')dnl
foo
[EMAIL PROTECTED]:~/tmp$ ./asdf.m4
#!/usr/bin/m4
foo here

the example above will display the #!/usr/bin/m4
I know a wrapper can filter the first line,
But Is it possible to do it in m4 directly?

Actually, no there is no straight forward way to do it in m4 right
now.  It *is* a good idea though, and I will add it to M4-2.0.

In the mean while, I would write:

$ cat aoeu.m4
#!/bin/sh

exec m4 <<'EOF'
define(`foo', ```foo' here'')dnl
foo
EOF
exit 1
$ ./aoeu.m4
`foo' here

HTH,
        Gary.
--
Gary V. Vaughan      ())_.  [EMAIL PROTECTED],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

_______________________________________________
M4-discuss mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/m4-discuss

Reply via email to