[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

one input producing multiple output

From: Doug McIlroy
Subject: one input producing multiple output
Date: Mon, 19 Feb 2018 09:03:30 -0500
User-agent: Heirloom mailx 12.5 7/5/10

> is the answer to do this in multiple passes with different sets of macros?

Other possibilities:

1. A single output stream interspersed with diversion tags to be
postprocessed by, say, an awk script to distribute it to the
several files.

2. Use syscmd to deliver fragments to files: "echo stuff >>file".
To avoid creating hundreds of processes, "stuff" could be gathered
in diversions. (This approach is baroque, but it does get the
whole job described in a single program.)

[I once described a macroprocessor as a "switchyard for data streams".
Odd, isn't it, that top-level switching is not included among m4's long
list of features.]


reply via email to

[Prev in Thread] Current Thread [Next in Thread]