groff
[Top][All Lists]
Advanced

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

Re: [Groff] Trouble switching to groff, macro gives syntax error...


From: Ralph Corderoy
Subject: Re: [Groff] Trouble switching to groff, macro gives syntax error...
Date: Wed, 16 Sep 2015 11:06:03 +0100

Hi Anton,

> >    $ (printf '.pl 1i\n.ll 2i\n'; yes 'a \n%') | nroff | sed 13q
...
> I can reproduce this on my FreeBSD box, but I cannot figure out how
> this works?  Can you really send a never ending stream to nroff?

Sure.  It does output-line-at-a-time formatting.  Even
paragraph-at-a-time that some troff versions have is presumably limited
to a page?

I see no difference in nroff's memory usage as 1000 increases ten times
each time in

    seq 1000 | nroff | LC_ALL=C grep . | tail -1

> And why do you need seq?  I get the same result with just head:
> $ ( printf '.pl 1i\n.ll 2i\n' ; yes 'a \n%' ) | nroff | head -n13

Why use head(1)?  Why did Berkeley even bother to create head when sed
already existed and had the functionality?

I'm assuming you know about the SIGPIPE, or EPIPE return from write(2),
that occurs when sed closes its stdin, nroff's stdout, and how that
ripples back through the pipeline, causing yes(1) to stop?

Cheers, Ralph.



reply via email to

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