Using sed to replace 1 line with a multi-line variable in ksh
Solution 1:
$ value1="DUTY FORECASTER:"
$ echo -e 'abc\ndef\nghi\ndef\n' | sed "s/def/def\n$value1/g"
abc
def
DUTY FORECASTER:
ghi
def
DUTY FORECASTER:
$ value1="DUTY FORECASTER:"
$ echo -e 'abc\ndef\nghi\ndef\n' | sed "s/def/def\n$value1/g"
abc
def
DUTY FORECASTER:
ghi
def
DUTY FORECASTER: