Hacker News new | ask | show | jobs
by porlw 641 days ago
This can easily be done with a small shell script and standard linux commands.

   #!/usr/bin/bash
   
   MAILTEXT=$(grep "dbkey" db.txt)
   
   cat emails.lst|while read ADDR NAME
   do
      mail -s "Subject" $ADDR <<EOT
   Dear $NAME

   $MAILTEXT

   EOT
   
   done
Schedule with cron.
1 comments

This is unsafe (glob injection).

Never use bash unless you know exactly what you are doing, and even then, better don't.

Even worse to recommend bash to somebody who already stated that they don't know what they are doing.

Just use Python for such scripts, it won't let you shoot yourself into the foot with surprising behavior.