DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH
 

(m4.info.gz) Esyscmd

Info Catalog (m4.info.gz) Syscmd (m4.info.gz) UNIX commands (m4.info.gz) Sysval
 
 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.
 
    Prior to executing the command, `m4' flushes its output 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'.
 
    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.
 
    The builtin macro `esyscmd' is recognized only when given arguments.
 
Info Catalog (m4.info.gz) Syscmd (m4.info.gz) UNIX commands (m4.info.gz) Sysval
automatically generated byinfo2html