Re: [List] Re: Nice easy sed question

From: Arthur Chance <freebsd_at_qeng-ho.org>
Date: Fri, 12 Sep 2025 11:22:36 UTC
On 12/09/2025 08:58, Frank Leonhardt wrote:
> This is a reply to several including Bob, Sad and Kyle.
> 
> TLDR: The methods and syntax I was using are fine on GNU sed but
> BSD sed appears to require a newline and there's no way around it.
Presuming you're working with sh or bash (as opposed to {t,}csh) and
it's having an actual newline that's annoying, you can always use sh's
dollar single quote strings. Then you get the alternate annoyance of
backslash doubling instead.

sed  -i.bak  -e $'/Line 2/a\\\nNew Line' example.txt

-- 
Vibe coding - the technical debt of tomorrow.