LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices

Reply
 
Search this Thread
Old 09-25-2006, 09:13 AM   #1
zonemikel
Member
 
Registered: Apr 2006
Posts: 94

Rep: Reputation: 15
Linux command mail question very easy for you not for me !


Ok im kinda confused as to how linux mail from the command works, it seems to have its own built in mailing thing i can send mail using echo "message" | mail -s "subject" somone@somedomain.com so i thought i would make that in a batch script and whiped something out really quick it basically said

Code:
i=0
while [$i -lt 9999]
do 
echo "message" | mail -s "subject" $i@somedomain.com
echo "sending message to $i@somedomain.com"
clear
let $i=$i+1
done
Well why in the hell would i do that, i dont know but hindsight is 20/20 right? Anyway my screen filled with text when i ran the script sending out emails at blazing fast speeds (or so i thought) after it got to around a thousand it stopped and i ctrl-c to get out of it. Then i couldnt send mail to anyone i tried using it from the command prompt and every way i could. So i left it alone and went to bed, the next morning i woke up and i still couldnt send mail so i restarted the box. As soon as i logged in beep, beep, beep ... new mail with the subject: WARNING could not send message for the past 4 hours its been about 30min and they are still coming in .. a little slower now but they are still coming. I would imagine these are returned mail that couldnt be sent?
My question is what the hell happened ? is there a limit ? I now have a sleep command before the done part of my script and im getting ready to run it again soon. any ideas ?

**UPDATE** i had let $i=$i+1 in my code but i was writing it here from memory so i didnt add that part, but now i added it to the above code. It did incrament when i ran it but i think it like ran too fast and didnt allow the process to complete before starting another mail instance ? but why do i get all this return mail to root ?

Last edited by zonemikel; 09-25-2006 at 12:42 PM.
 
Old 09-25-2006, 11:59 AM   #2
jonlake
Member
 
Registered: Apr 2004
Distribution: Slackware 11.0, Gentoo
Posts: 252

Rep: Reputation: 31
First hing that comes to mind

Look at your script. When is $i ever going to not be less than 9999? Never. You aren't incrementing your variable at all. You may want to put his after the echo commands, or the clear command.

Code:
$i++
This will increment the variable by one each time your script runs).
 
  


Reply


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
simple and easy ls command question basher400 Linux - Newbie 1 06-15-2005 08:26 AM
Cannot send mail with mail() command in PHP 4.3.4, Apache 2.0.48, Mandrake Linux 10 arcanum Linux - General 3 06-27-2004 06:06 PM
Easy question on mail jkcunningham Linux - Networking 11 08-20-2003 11:34 AM
Easy question on a command moose1618 Linux - General 5 03-24-2002 11:05 AM
Easy Question on Copy Command aklinuxuser Linux - Newbie 1 08-29-2001 05:55 PM


All times are GMT -5. The time now is 04:00 PM.

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