Share your knowledge at the LQ Wiki.
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 09-25-2006, 10:13 AM   #1
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" so i thought i would make that in a batch script and whiped something out really quick it basically said

while [$i -lt 9999]
echo "message" | mail -s "subject" $
echo "sending message to $"
let $i=$i+1
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 01:42 PM.
Old 09-25-2006, 12:59 PM   #2
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.

This will increment the variable by one each time your script runs).


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 09: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 07:06 PM
Easy question on mail jkcunningham Linux - Networking 11 08-20-2003 12:34 PM
Easy question on a command moose1618 Linux - General 5 03-24-2002 12:05 PM
Easy Question on Copy Command aklinuxuser Linux - Newbie 1 08-29-2001 06:55 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 03:30 PM.

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