groff
[Top][All Lists]
Advanced

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

Re: how far can i go with grotty?


From: Marc Chantreux
Subject: Re: how far can i go with grotty?
Date: Mon, 27 Jul 2020 09:31:51 +0200
User-agent: Mutt/1.10.1 (2018-07-13)

hello John,

On Sat, Jul 25, 2020 at 02:57:13PM +1000, John Gardner wrote:
> >
> > also: i need "sed '/^$/q'" at the end of my filter because groff
> > renders a lot of empty lines at the end of the output whenever i
> > use b in my tbl format. i don't know how to remove it.

> sed -e :a -e '/^\n*$/{$d;N;};/\n$/ba'

thanks for this answer, however my attempt was to remove the sed command
itself.

> sed -e :a -e '/^\n*$/{$d;N;};/\n$/ba'

i have to admit i had to split it so i can read it

  sed ' :a
        /^\n*$/ {
            $d
            N
        };
        /\n$/ba
  '

and yet i'm confused: can you explain the benefit of it over my simple
and working sed '/^$/d' ?

regards
marc



reply via email to

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