Ah, then the amended sed line should work just beautifully. I just checked it on my Linux machine and it went swimmingly. You probably should change the /bin/sh reference to /bin/bash (or what ever the path is to bash on your machine) to make sure it's calling bash as the script's interpreter as well.
Absolute worst case, I can whip up a perl script to do the same thing and just PM it over