Dear all,
I try to replace a string of characters in a file (MyFile.txt) by a multiline value of the variable "Myvar":
[x004191a@xsnl11p317a TEST_DAE]$ cat MyFile.txt
DESCRIPTION '@TargetTable SCHEMA'
(
@InputFlowDef
);
[x004191a@xsnl11p317a TEST_DAE]$
The content of Myvar:
[x004191a@xsnl11p317a TEST_DAE]$ echo "$Myvar"
col1
, col2
, col3
[x004191a@xsnl11p317a TEST_DAE]$
Using sed command in the following way, I got the error:
[x004191a@xsnl11p317a TEST_DAE]$ sed "s/@InputFlowDef/$Myvar/" MyFile.txt
sed: -e expression #1, char 20: unterminated `s' command
[x004191a@xsnl11p317a TEST_DAE]$
My aim is to get the following result:
[x004191a@xsnl11p317a TEST_DAE]$ cat MyFileResult.txt
DESCRIPTION '@TargetTable SCHEMA'
(
col1
, col2
, col3
);
[x004191a@xsnl11p317a TEST_DAE]$
Any help would be greatly appreciated,
Didier.