If you want
m4 to read the output of a shell command, use
Expands to the standard output of the shell command shell-command.
Prior to executing the command,
m4flushes its buffers. The default standard input and standard error of shell-command are the same as those of
m4. The error output of shell-command is not a part of the expansion: it will appear along with the error output of
By default, the shell-command will be used as the argument to the -c option of the /bin/sh shell (or the version of sh specified by ‘command -p getconf PATH’, if your system supports that). If you prefer a different shell, the configure script can be given the option --with-syscmd-shell=location to set the location of an alternative shell at GNU
m4installation; the alternative shell must still support -c.
esyscmdis recognized only with parameters.
define(`foo', `FOO') ⇒ esyscmd(`echo foo') ⇒FOO ⇒
Note how the expansion of
esyscmd keeps the trailing newline of
the command, as well as using the newline that appeared after the macro.
Just as with
syscmd, care must be exercised when sharing standard
m4 and the child process of