merge serial sed commands into single commands

Untested, but this here's the way it's done.