[ENSIM] Emailing all site administrators via the command line
The following command will list each siteadmin's email address (one address per line):
cat /home/virtual/site*/info/current/siteinfo | \
grep email | awk {'print ( $3 )'}
You can use this in conjunction with a for loop to email each site admin:
for x in `cat /home/virtual/site*/info/current/siteinfo | \
grep email | awk {'print ( $3 )'}`; \
do mail -s "Message Subject" $x < message.txt; done
This assumes you have created your email body in the file message.txt.
back
