m41
Macro processor
Usage
m4 [OPTION] ...
[FILE] ...
Overview
Process macros in FILEs. If no FILE or if FILE is `-', standard input is read.
Mandatory or optional arguments to long options are mandatory or optional for short options too.
Operation modes:
-
--help -
display this help and exit
-
--version -
output version information and exit
-
-E, --fatal-warnings -
once: warnings become errors, twice: stop execution at first error
-
-i, --interactive -
unbuffer output, ignore interrupts
-
-P, --prefix-builtins -
force a `m4_' prefix to all builtins
-
-Q, --quiet, --silent -
suppress some warnings for builtins
-
--warn-macro-sequence[=REGEXP] -
warn if macro definition matches REGEXP,
-
default \$\({[^}]*}\|[0-9][0-9]+\)
Preprocessor features:
-
-D, --define=NAME[=VALUE] -
define NAME as having VALUE, or empty
-
-I, --include=DIRECTORY -
append DIRECTORY to include path
-
-s, --synclines -
generate `#line NUM "FILE"' lines
-
-U, --undefine=NAME -
undefine NAME
Limits control:
-
-g, --gnu -
override
-Gto re-enable GNU extensions
-
-G, --traditional -
suppress all GNU extensions
-
-H, --hashsize=PRIME -
set symbol lookup hash table size [65537]
-
-L, --nesting-limit=NUMBER -
change nesting limit, 0 for unlimited [0]
Frozen state files:
-
-F, --freeze-state=FILE -
produce a frozen state on FILE at end
-
-R, --reload-state=FILE -
reload a frozen state from FILE at start
Debugging:
-
-d, --debug[=FLAGS] -
set debug level (no FLAGS implies `aeq')
-
--debugfile[=FILE] -
redirect debug and trace output to FILE (default stderr, discard if empty string)
-
-l, --arglength=NUM -
restrict macro tracing size
-
-t, --trace=NAME -
trace NAME when it is defined
FLAGS is any of:
a
|
show actual arguments |
|---|---|
c
|
show before collect, after collect and after call |
e
|
show expansion |
f
|
say current input file name |
i
|
show changes in input files |
l
|
say current input line number |
p
|
show results of path searches |
q
|
quote values as necessary, with a or e flag |
t
|
trace for all macro calls, not only traceon'ed |
x
|
add a unique macro call id, useful with c flag |
V
|
shorthand for all of the above flags |
If defined, the environment variable `M4PATH' is a colon-separated list of directories included after any specified by `-I'.
Exit status is 0 for success, 1 for failure, 63 for frozen file version mismatch, or whatever value was passed to the m4exit macro.
Releases
14 releases since Debian 2.2 (Potato); the text changed 9 times.
--arglength since Debian 4.0 (Etch);
--debug since Debian 4.0 (Etch);
--debugfile since Debian 4.0 (Etch);
--define since Debian 4.0 (Etch);
--fatal-warnings since Debian 4.0 (Etch);
--freeze-state since Debian 4.0 (Etch);
--gnu since Debian 6.0 (Squeeze);
--hashsize since Debian 4.0 (Etch);
--help since Debian 4.0 (Etch);
--include since Debian 4.0 (Etch);
--interactive since Debian 4.0 (Etch);
--nesting-limit since Debian 4.0 (Etch);
--prefix-builtins since Debian 4.0 (Etch);
--quiet since Debian 4.0 (Etch);
--reload-state since Debian 4.0 (Etch);
--silent since Debian 4.0 (Etch);
--synclines since Debian 4.0 (Etch);
--trace since Debian 4.0 (Etch);
--traditional since Debian 4.0 (Etch);
--undefine since Debian 4.0 (Etch);
--version since Debian 4.0 (Etch);
--warn-macro-sequence since Debian 5.0 (Lenny);
-D since Debian 4.0 (Etch);
-E since Debian 4.0 (Etch);
-F since Debian 4.0 (Etch);
-G since Debian 4.0 (Etch);
-H since Debian 4.0 (Etch);
-I since Debian 4.0 (Etch);
-L since Debian 4.0 (Etch);
-P since Debian 4.0 (Etch);
-Q since Debian 4.0 (Etch);
-R since Debian 4.0 (Etch);
-U since Debian 4.0 (Etch);
-d since Debian 4.0 (Etch);
-g since Debian 6.0 (Squeeze);
-i since Debian 4.0 (Etch);
-l since Debian 4.0 (Etch);
-s since Debian 4.0 (Etch);
-t since Debian 4.0 (Etch).
--word-regexp until Debian 13 (Trixie);
-W until Debian 13 (Trixie).