using sed instead of gawk

v4.1.0 with inplace editing is not available in Ubuntu Trusty.