I would write something that would make that easy, something like this, which would take a little more work to output to a file at the end of the pipe, and to use the indirect object syntax of exec, so that even a command with no arguments is (update: slightly more) secure.