Created
December 7, 2020 20:40
-
-
Save zkylab/08f379d3811fe1d6987a14eddf112989 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# mails_raw.txt ==> Ken Thomson 555 1234567 ken0[at]thomson.com ... etc. | |
input="mails_raw.txt" | |
regex="(\w{1,})\[at\](\w{1,}\.\w{1,})" | |
while IFS= read -r line | |
do | |
while [[ $line =~ $regex ]]; do | |
echo "${BASH_REMATCH[1]}@${BASH_REMATCH[2]}" >> mail.txt | |
line=${line#*"${BASH_REMATCH[1]}"} | |
done | |
done < "$input" | |
input="mail.txt" | |
while IFS= read -r line | |
do | |
echo $line | |
echo “İyi sınavlar!” | mail -s “Sınav” $line | |
done < "$input" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment