There are a few builtin macros in m4 that allow you to run UNIX commands from within m4.
m4
Go to the first, previous, next, last section, table of contents.