Register
It is currently Wed Oct 01, 2014 6:13 am

Variables in heredoc


All times are UTC - 6 hours


Post new topic Reply to topic  [ 2 posts ] 
Author Message
 PostPosted: Tue May 22, 2012 6:36 pm   

Joined: Mon Apr 27, 2009 2:24 pm
Posts: 10
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?


Code:
#Sending mail notification
when=`/bin/date`
/usr/sbin/sendmail -t >2 <<-EOM
Subject:User access disabled.
From:testuser@test.com
To:$EMAIL
User $USERNAME has been disabled.


Regards,
$variable Support.

${when}
EOM


Top
 Profile  
 PostPosted: Wed May 23, 2012 3:51 pm   

Joined: Mon Mar 02, 2009 3:03 am
Posts: 549
hi,

Code:
echo "your
long
message" | tee ./message_file | sendmail ...
is that it?


Top
 Profile  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: No registered users and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  


BashScripts | Promote Your Page Too
Powered by phpBB © 2011 phpBB Group
© 2003 - 2011 USA LINUX USERS GROUP