Contents | < Browse | Browse >
Reading the output of commands
==============================
If you want `m4' to read the output of a Unix command, use `esyscmd':
esyscmd(SHELL-COMMAND)
which expands to the standard output of the shell command SHELL-COMMAND.
The error output of SHELL-COMMAND is not a part of the expansion. It
will appear along with the error output of `m4'. Assume you are
positioned into the `checks' directory of GNU `m4' distribution, then:
define(`vice', `esyscmd(grep Vice COPYING)')
=>
vice
=> Ty Coon, President of Vice
=>
Note how the expansion of `esyscmd' has a trailing newline.