move extra pipe command into sed script

* also, don't try to move a file into itself