termrec: use inreplace instead of sed