groff
[Top][All Lists]
Advanced

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

Re: One groff file outputting multiple pdfs?


From: James K. Lowden
Subject: Re: One groff file outputting multiple pdfs?
Date: Fri, 20 Nov 2020 12:57:29 -0500

On Thu, 19 Nov 2020 18:15:32 -0500
Richard Morse <pukku@mac.com> wrote:

> This would simplify a lot of things, because this kind of thing could
> be easily be put into the roff file when I?m generating that.

Good, so if .OUT is your marker, here's a working script: 

#! /usr/bin/awk -f

/^[.]OUT/ {
    if( output ) {
        system( "nroff -ms " input " > " output )
        system( "rm " input )
    }
    input  = "tmp/" $2
    output = "output/" $2
    next
}

{
    print > input
}

END {
    if( output ) {
        system( "nroff -ms " input " > " output )
        system( "rm " input )
    }
}

> I?m going to have to generate 15 different roff files for each time I
> run this.

As you can see, the script cleans up after itself.  :-)   

--jkl



reply via email to

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