Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 04-21-2012, 09:37 PM   #1
LQ Newbie
Registered: Apr 2012
Posts: 1

Rep: Reputation: Disabled
Mail looping script and automation help

Hell guys

I decided to make a rather simple looping script, however for some reason i can't automate the . and enter. Those are required to send the emails from the terminal. I tried using the \n but nothing.

Thanks for the help, heres the script.


for (( c=0; c<2; c++ )) do

SUBJECT="Security Breach!!"

echo "Security Breach!" >> $MESSAGE
echo "Time: `date`" >> $MESSAGE

/usr/bin/mail -s "$SUBJECT" "$TO"


Old 04-22-2012, 12:59 AM   #2
LQ Guru
Registered: May 2005
Location: boston, usa
Distribution: fedora-30
Posts: 5,295

Rep: Reputation: 916Reputation: 916Reputation: 916Reputation: 916Reputation: 916Reputation: 916Reputation: 916Reputation: 916
i think
cat $MESSAGE | /usr/bin/mail -s "$SUBJECT" "$TO
should work.
1 members found this post helpful.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
looping in script fw12 Programming 3 11-04-2009 04:48 PM
looping startup script kirukan Linux - Newbie 3 07-10-2009 03:25 PM
Mail is looping back alitrix Linux - Server 18 10-19-2008 05:29 AM
Looping a script Keentolearn Linux - Newbie 4 01-30-2007 04:54 PM
Qmail - Backup server looping mail ziggie216 Linux - Software 0 10-04-2005 01:44 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 12:32 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration