Instantly share code, notes, and snippets.

Embed
What would you like to do?
#!/bin/bash
# Example for : https://blog.madrzejewski.com/traiter-json-shell-cli
set -euo pipefail
LC_ALL=C
OLD_IFS=$IFS
IFS=$'\n'
cpapi2 --output=json --user=mondev Email listpops | jq -c '.cpanelresult.data[] | {email: .email}' | while read json ; do
email=$(echo $json | jq -r .email)
echo "Envoi à $email"
echo "Contenu de mon message" | mail -s "Sujet" $email
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment