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

Re: POSIX compliant sed making newline character



On 8/21/2020 8:37 PM, Greg Wooledge wrote:
On Fri, Aug 21, 2020 at 02:35:35PM -0400, Greg Wooledge wrote:
No.  Use $'...' instead of '...'.

sed '/line1/{N;N;a line-to-add\n}' input-file

Crap.  Of course I meant to write

sed $'/line1/{N;N;a line-to-add\n}' input-file


Okay, it uses the same syntax as for a subshell '$()'.

Next step is to find a way in which I can use variable substitution.

I appriciate your help Greg.


--
John Doe


Reply to: