groff
[Top][All Lists]
Advanced

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

Re: Portability to Mac OS X (was: Sed failure in contrib/sboxes on MacOS


From: Ralph Corderoy
Subject: Re: Portability to Mac OS X (was: Sed failure in contrib/sboxes on MacOS)
Date: Fri, 29 Oct 2021 10:07:39 +0100

Hi John,

> In lieu of escaped newlines and awkward sed(1) formatting, you can use
> the following line to insert an empty line:
>
> /^Before$/ { N; s/\n/&&/; }

With the caveat that the line read by N won't be processed as it would
have been otherwise.  These two show the difference which might not
matter in some cases.

    seq 10 29 | sed $'/5$/i\\\n\n/^2/s//x/'
    seq 10 29 | sed $'/5$/{N;s/\\n/&&/}\n/^2/s//x/'

-- 
Cheers, Ralph.



reply via email to

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