I've stumbled over a little problem. Most of my scripts email confirmation of success or failure. I do this by having a namelist file with a list of addresses to mail.
Because a fair few scripts run now I am started to collect far too many namelist files.
I figure if I can selectively choose from this list then I can put all names in one file and let the script decide.
I do it as follows:
while read namelist
do
mailx $namelist<<-EOF
TEXT TO SEND
Datamart Support
EOF
done<$namelist
This method only allows me to send to an entire file of names.
I thought a case statement that identifies addresses and sends mail, or not, depending on the name.
Problem is, how do I exit from that iteration of the loop but continue with the rest? An "exit" statment will exit the loop and script as well so that's no good.
does anyone have any ideas
cheers
simmo
Because a fair few scripts run now I am started to collect far too many namelist files.
I figure if I can selectively choose from this list then I can put all names in one file and let the script decide.
I do it as follows:
while read namelist
do
mailx $namelist<<-EOF
TEXT TO SEND
Datamart Support
EOF
done<$namelist
This method only allows me to send to an entire file of names.
I thought a case statement that identifies addresses and sends mail, or not, depending on the name.
Problem is, how do I exit from that iteration of the loop but continue with the rest? An "exit" statment will exit the loop and script as well so that's no good.
does anyone have any ideas
cheers
simmo