To read a file line by line from BASH you can use one of the following options:
- While, read, operator <
- cat, while, read
- AWK
For example, if we have the following file (emails.txt):
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
Option 1
$ while read line; do echo "Sending email to $line"; done < emails.txt
Option 2
$ cat emails.txt |while read line; do echo "Sending email to $line"; done
Option 3
I suggest AWK if the file has more than one column since AWK allows to specify columns separator, if we have the following file:
Sybil|[email protected]
Neville|[email protected]
Sean|[email protected]
then we can type:
awk -F'|' '{email=$1" <"$2">"} {print "Sending email to "email;}' emails.txt
Congratulations @srdotlibre! You have completed the following achievement on the Hive blockchain and have been rewarded with new badge(s) :
You can view your badges on your board and compare yourself to others in the Ranking
If you no longer want to receive notifications, reply to this comment with the word
STOP
Do not miss the last post from @hivebuzz:
Yay!
Your post has been boosted with Ecency Points. Keep up the good work!
Dear reader, Install Android: https://android.ecency.com, iOS: https://ios.ecency.com mobile app or desktop app for Windows, Mac, Linux: https://desktop.ecency.comLearn more: https://ecency.com Join our discord: https://discord.me/ecency