Adopted sed call to work on both OSX and Linux.