Sed: unescaped newline inside replacement template?

This code:

echo Foo | sed -e 's/Foo/Bar' 

results in an unescaped newline inside substitute pattern (instead of the expected Bar ).

I obviously miss something simple, bash / sed / escaping related, but I can't find out what causes this?

+5
source share
1 answer

You are missing the final / :

 echo Foo | sed -e 's/Foo/Bar/' 
+7
source

Source: https://habr.com/ru/post/1239719/


All Articles