Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

sed: unescaped newline inside substitute pattern?

This code:

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

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

I'm obviously overlooking something simple, bash/sed/escaping related, but I can't find out what's causing this?

like image 286
RocketNuts Avatar asked Jan 03 '16 12:01

RocketNuts


1 Answers

You are missing terminating /:

echo Foo | sed -e 's/Foo/Bar/'
like image 60
anubhava Avatar answered Nov 07 '22 18:11

anubhava