I have table named student in a mysql database. This table has column named email.
I use following command to send email to specific student, identified by pid:
$email=$(mysql --login-path=local --database=ccps -ss -e "select email from student where pid=132054");
echo "This is sample mail" | mail -s "Test" $email
I want to know how to send email to each and every student in the database. As I don't know how to use loop on column email.
Thank You.
xargs.