Hello:
I am a greenie @ unix scripting and looking for some input as to how to solve the problem I have below.
Below is representation of what is found in file em.data
VenNu Sts controlnu typ email
111111 LATE 321321321 997
xxxxx@xxxx.com
222222 LATE 321321321 997
xxxxx@xxxx.com
The objective is to write a script that can read each line in the em.data file and send a corresponding email notification for each respective email account. Here vendor number 111111 will have different email account than vendor number 222222 and their line information will also differ.
What I have so far is the script below but it does differentiate between email addresses and sends all data to each respective email address. What would be some of your suggestions.
############################
file=em.data
COLA=`cut -f1 $file`
COLB=`cut -f2 $file`
COLC=`cut -f3 $file`
COLD=`cut -f4 $file`
Email=`cut -f3 $file`
for i in $email ; do
echo $COLA $COLAB $COLAC $COLAD | mailx -s "Notifications" -r
edi@flyingj.com $i
done