Hi, At Tue, 21 Oct 2008 03:30:44 +0900, jackster the jackle wrote in [ruby-talk:318164]: > Once I added some gsub code to remove those characters, all is working > well and I get an email with the error regardless of whether a shell > command or ruby code were the cause of the error. Here is my final code > which I will now implement in all my scripts (unless someone sees > another problem) so I'm no longer blind sided by know-it-alls here at > work that come to me with "you know your scripts have failed, don't > you?" :-) I'd rather use popen. > rescue Exception => e > if e > puts e IO.popen("-", "w") do |mail| mail or exec(*%w"/usr/sbin/sendmail -f my_server / gmail.com john.smith / email.com") mail.puts "Subject: Script Error: #{e.backtrace[0]}" mail.puts mail.puts e # and anything what you want to send end > end > end -- Nobu Nakada