Recoded with help from Toby to use rewriting instead of the
subst rule -- the latter was too slow. But it must resort to the subst rule
if the equality contains Vars.
#! /bin/sh
# teeinput -- start a program and log all inputs to a file
# environment variable $LISTEN specifies the file name
tee -a -i $LISTEN | $*