On 11/19/20, Richard Morse <pu...@mac.com> wrote: > For reasons having to do > with how it is being run, it’s not clear to me that I can automate running > groff, so right now I am manually running the groff command for each > generation.
Hi Richard, It's not entirely clear what your workflow is, or why groff can't be run from within a simple shell script or Makefile as James proposed. But taking that restriction as a given, does your workflow require that the input be a *groff* file? Or only that it be a single file? If you are running it manually, it seems it could just as easily be a shell script, right? If your actual requirements are (a) there be only one input file, and (b) it produce multiple output files, this is straightforward to do in a file that's *mostly* groff, but with a handful of shell lines between each set of input: groff -ms > out1.ps << EOF .LP Contents of file 1 EOF groff -ms > out2.ps << EOF .LP Contents of file 2 EOF Generating such a file seems conceptually no more complex than your example of emitting hypothetical groff requests to change the output file. Then the manual step need only be done on one file, but you'd just execute the file directly rather than calling groff on the command line.