I write a bash script to replace the keyword with the whole content of another file. Here is the command I use:
sed -i "s/CONTENT/$(cat $pathB)/" $pathA
A file
Here is my introduction:
CONTENT
Thank you.
B file
I'm OOO.
I'm 10 years old.
I like play baseball
Result A file
Here is my introduction:
I'm OOO.
I'm 10 years old.
I like play baseball
Thank you.
But this will show error:
sed: -e expression #1, char 14: unknown option to `s'
What am I doing wrong?