If 'mail' is hanging, it might be a good idea to find out why.
hey Corona, thanks for the detailed help.
So basically I am trying out your script however I have a question about $! 's- functionality.
does it pick from within the script the most recent shell script or does it grab from all running scripts.
I am wonderring cause the documentation on it is confusing me. and the way we schedule linux scripts we have many running simultaneously and any clarification you can give me on $! would help clear my worries about it. - I am still googling
but does it grab from the entire history linux processes running at the time or will it only grab from within the script.
I will post my final script later so you guys can look and see what I was trying in the first place.
and FYI- the reason I am seperating the DB-connections is that the system hangs on lets say the first variable assignment which is a query from the DB.
--Your solution seems to cover it so thanks, -will be testing it for a day or so to see it on my dev environment. -I will proably use once I understand the scope of $!
Thanks.
---------- Post updated at 10:50 AM ---------- Previous update was at 10:30 AM ----------
I understand $! grabs from inside script can someone confirm??
hey Corona, thanks for the detailed help.
So basically I am trying out your script however I have a question about $! 's- functionality.
does it pick from within the script the most recent shell script or does it grab from all running scripts.
$! is the process ID of whatever you backgrounded (i.e, ran with &) most recently inside the current shell.
So if you did ( .... ) & you would get the process ID of the subshell.
If you did sleep 1000 & you would get the process ID of sleep without any subshell involved at all.
etc.
BASH also has another meaning for "!", which relates to the shell history -- but, like aliases, this does not happen inside a shell script, only in live interactive terminal sessions.
You might want to comment out the echo inside that loop before deploying. I'm not sure where all those debug statements will end up, if anywhere. Don't want them piling up in some neglected logfile
Will do and thanks for the heads up!
is there a any logs in specific your thinking of? i'm just curious.
what causes the pileup ? termination of the script ?
Will do and thanks for the heads up!
is there a any logs in specific your thinking of? i'm just curious.
I don't know, that depends on what's running it. That's why any programs you write should make as little noise as possible unless they actually have anything important to say.
If it's run by an init script, it might end up somewhere in /var/log.
If it's run by cron, any program output from that gets automatically emailed to user@hostname via the server's own MTA... or dumped in $HOME/dead.letter if none's available. (Meaning, if it is cron-ed, it might be possible to simplify that script by letting cron do the mailing for it.)
etc.
It might go nowhere at all. It's not THAT big a deal in the end. I just don't want you to end up with a slowly growing file under /var/log which will get ignored for 10 years until the partitions full... Or a confused customer wondering why they're suddenly getting 3 emails full of nonsense a day
Whats the difference between mail and mailx?
I'm trying to troubleshoot a problem where I can send mail from server A with this `echo $MESSAGE | mail -s "$SUBJECT" -r $FROM $RECIPIENTS` command but executing the same command from server B throws me this error (Both servers are RHEL)
... (1 Reply)
How can i send a mail when user login in unix ENV.
How can i know present use mailID??
Moved out of Contact Us Forum - Please Do Not Post Technical Questions in Non-Technical Forum(s) (1 Reply)
Hi guys...
I am busy writing a script to notify me via an mail if my application is down. I have done that.
Now I want this script to stop sending mails after five mails were sent but the script should keep on checking the application.
When the application is up again that count should be... (5 Replies)
i want to send an email from the unix machine to the windows machine.
now windows dont have any specified folder for the mail. mail has to be sent to the email-id like abc@xyz.com
unix machine itself can not directly send mail.
it has to be transferred via mail server. (11 Replies)
Hi,
I am want to send mails from my aix server using smtp adaptors.How to configure this? i tried with send mail command but it is failing,but what i try with my localhost(my desktop which is not using the aix server) machine i can send mails using the smtp adaptor(simply type telnet... (0 Replies)
Dear all,
how can i send mail using mailx or mail command?do i need to configure anything for sending mail?please help me.Its urgent.
the version i use is
Linux TDM 2.4.21-4.EL #1 Fri Oct 3 18:13:58 EDT 2003 i686 i686 i386 GNU/Linux
Thanks
Regards,
Pankaj (15 Replies)
Hi everyone!
I'm trying to create a database monitoring script that reads an alert file and sends an error message if it can 'grep' a particular string.
Is there a way to send this message to a mail client using SMTP?
Even better, is there any place on this site that has these kinds of... (5 Replies)