1,$s/foo/foo\
  inserted line/p
.=
w
