Yifei Kong

May 30, 2017

m4 tool

m4 macro language http://mbreen.com/m4.html

comman line invoking

m4 -D

builtins

define(, ) undefine() ifdef(, , ) ifelse(, , , ) eval() len() include() syscmd() `'are quotes

for comments

M4 rules it reads in the macro's arguments (if any) it determines the expansion of the macro and inserts this expansion at the beginning of its input m4 continues scanning the input, starting with the expansion

example: define(definenum',define(num',99')') num # -> num definenum num # -> define(num',99') num -> 99

Unless a nested macro is quoted, it is expanded immediately:

define(definenum', define(num', `99')) num # -> 99 definenum # ->