DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 

(m4.info.gz) Esyscmd

Info Catalog (m4.info.gz) Syscmd (m4.info.gz) Shell commands (m4.info.gz) Sysval
 
 12.3 Reading the output of commands
 ===================================
 
 If you want `m4' to read the output of a shell command, use `esyscmd':
 
  -- Builtin: esyscmd (SHELL-COMMAND)
      Expands to the standard output of the shell command SHELL-COMMAND.
 
      Prior to executing the command, `m4' flushes its buffers.  The
      default standard input and error output 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 `m4'.
 
      The macro `esyscmd' is 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
 input between `m4' and the child process of `esyscmd'.
 
Info Catalog (m4.info.gz) Syscmd (m4.info.gz) Shell commands (m4.info.gz) Sysval
automatically generated byinfo2html