fixed non-standard sed invocation for BSD compatibility

kudos to @cdent for figuring this out

(it was originally written that way for readability)