I currently use this message to send e-mails in a script but I would also like to save the output of this code to a file as well while preserving the variables. What's the easiest way to accomplish this?
/usr/sbin/sendmail -t >2 <<-EOM
Subject:User access disabled.
User $USERNAME has been disabled.