m4
text processingLinux/Unix
The m4 command is one of the most frequently used commands in Linux/Unix-like operating systems. m4 Macro processor
Quick Reference
Command Name:
m4
Category:
text processing
Platform:
Linux/Unix
Basic Usage:
m4 [options] [arguments]
Common Use Cases
Syntax
m4 [options] [files]
Options
Option | Description |
---|---|
-D, --define=NAME[=VALUE] |
Define NAME as having VALUE or empty |
-I, --include=DIRECTORY |
Add DIRECTORY to include path |
-s, --synclines |
Generate line sync lines for debugging |
-P, --prefix-builtins |
Prefix all built-in macros with 'm4_' |
-Q, --quiet, --silent |
Suppress some warnings |
-E, --fatal-warnings |
Treat warnings as errors |
-G, --traditional |
Suppress all GNU extensions |
-H, --hashsize=PRIME |
Set symbol table hash size to PRIME |
-L, --nesting-limit=NUMBER |
Change nesting limit (default 1024) |
-F, --freeze-state=FILE |
Save frozen state to FILE at end |
-R, --reload-state=FILE |
Reload frozen state from FILE at start |
--error-output=FILE |
Redirect error messages to FILE |
-d, --debug[=FLAGS] |
Set debug level (no FLAGS implies 'aeq') |
-t, --trace=NAME |
Trace NAME when it is defined |
-l, --arglength=NUM |
Restrict macro tracing size |
-o, --debugfile=FILE |
Send debug and trace output to FILE |
Examples
How to Use These Examples
The examples below show common ways to use the m4
command. Try them in your terminal to see the results. You can copy any example by clicking on the code block.