I am passing to sed for replacement text that seems to have some characters that it does not like.
The text comes from git log graph and is something like:
ID- desc author
ID- desc author
I get unescaped newline inside substitute pattern
How can I escape everything before piping to sed?
Example:
COMMIT=$(git log my_branch...origin/master --pretty=format:'%h %an')
FINAL=$(cat msg.txt | sed -E "s/--PLACEHOLDER--/$COMMIT/)