Neither version works for me. The first version: output file is same as input file (no quotes were added). Second version: I'm getting an "undefined label" error from sed. I'm on OSX Lion, if that affects things.
–
dsgSep 20 '11 at 1:38

OSX is BSD based, that sed command doesn't work the same as GNU. One article I read mentioned you can't escape characters there as you can in GNU, the other mentioned the -i is interpreted slightly different as well.
–
OldWolfSep 21 '11 at 1:26