[Ilugc] mail command - doubt

  • From: ramana_muthu@xxxxxxxxxxx (Muthukumar)
  • Date: Thu Mar 31 17:23:26 2005

       i want to send my console output as e-mail. any option is
there in mail command?

Put in your shell profile file as,
script -qa /tmp/console_$(who -mu | awk '{ print $8 }' | tr -d '()').log
It will log all console log informations into it. And mail to during exit.

If you are using putty to connect to remote machine then simply do logging.

one more thing can we attach any files along
with that mail using mail command?

with uuencode utility.

cat <filename> | uuencode | mail "subject" <mail-id>

-muthukumar 



Other related posts: