M4 in Linux is a macro processor that can copy input to output and expand macros at the same time. Macros can be embedded or user-defined; m4 is part of the POSIX standard, all versions It can be used under Unix, so it can be used for referencing files, text editing and word processing in Linux.
#The operating environment of this tutorial: linux7.3 system, Dell G3 computer.
m4 is a general-purpose macro processor designed by Brian Collingham and Dennis Ritchie. The m4 is an extension of the m3 macro processor Ritchie had earlier developed for the AP-3 minicomputer.
m4 is part of the POSIX standard and is available under all versions of UNIX. Although the language can be used stand-alone, most people need m4 simply because the "configure" script in GNU autoconf relies on it.
Macro processors (or preprocessors) are generally used as text replacement tools. End users often use it to work with text templates that are used over and over again, typically in programming tools, but also in text editing and word processing tools.
M4 is a macro processor. It copies input to output and expands macros at the same time. Macros can be built-in or user-defined. In addition to expanding macros, m4 also has some built-in functions , used to reference files and execute Unix
m4 to provide the following functions:
Free-form syntax, not line-based syntax;
High degree of macro expansion (macro parameters will be expanded in scanning and interpolation)
Text replacement
Parameter replacement
File contains
String operation
Conditional judgment
Numerical operations
System interface
Programmer diagnostics
Independent of computer Programming language
Independent of natural language
Programmable
With most of the earlier macros Unlike processors, m4 is not oriented to any computer language or natural language; but historically, it was originally developed to support Ratfor, a dialect of Fortran. Additionally, m4 is a Turing-complete programming language.
Related recommendations: "Linux Video Tutorial"
The above is the detailed content of What is m4 in linux. For more information, please follow other related articles on the PHP Chinese website!