I have some file:
aaaaaaaaaa
# Lines Start #
bbbbbbbbb
cccccccc
dddddddddd
# Lines End #
eeeeeeeeee
And some variable $newLines="new line"
How can I replace the lines from # Lines Start # to # Lines End # (including those line themselves) with variable's value using sed.
so I'll get:
aaaaaaaaaa
new line
eeeeeeeeee
I've tried using: sed -E 'N; s/# Lines Start #\.*\# Lines End #/$newLines/'
But its not doing it's job.