Linux Today: Linux News On Internet Time.

Linux, Unix, /etc/: An Introduction to m4

Jul 21, 2005, 07:00 (0 Talkback[s])
(Other stories by Paul Dunne)

[ Thanks to Linux, Unix, /etc/ for this link. ]

"m4 is one of the unsung heroes of Linux and Unix. For instance, in that great book Unix Power Tools, not a single mention is made of it, though m4 has been a standard part of Unix since V7. So, what is it about m4 that makes it so useful, and yet so over-looked?

"m4 is a 'macro processor': a dry name that disguises a great facility. A macro-processor is basically a program that scans text looking for defined symbols, which it replaces by other text--or other symbols. Thus, it is a powerful general-purpose utility that can be used to automate many tasks people often end up doing in sed, awk, perl, or even their favourite text editor. However, this power and it's general-purpose nature is not at all obvious in the bare name, 'macro processor.' Also, Unix developers already have a built-in macro processor, in the form of the C pre-processor, built into their compiler. Perhaps it is this that accounts for m4's relative neglect. Whatever, this article hopes to show all Unix users the power and usefulness of this software tool..."

Complete Story

Related Stories: