g/baz/p\
s/baz/replaced/
.=
w
