1.sed: s/- baz/- elephant/; /^ - elephant/{h;G;} /^ - elephant/{h;G;} s/- elephant/- baz/; sed -f 1.sed foo|sed -a wfoo
1.sed: /^ - baz/a\ - elephant /^ - baz/a\ - elephant sed -f 1.sed foo|sed -a wfoo