Hi, everybody,
Now I have a file1 including:
fname:lname:email address(like xxxx@yahoo.com)
I want to email all users a message, the message is saved in file2.
I wrote:
nawk 'BEGIN{ FS=":"; n=1;
while (getline < "file2" > 0)
form[n++]=$0 }
{ print "Dear "$1,$2":" | "mail $3"
for ( i=1; i<n; i++)
{ msg=form
print msg | "mail $3" }
}' $file1
But "mail $3" doesn't work.
How can I pass the value of $3 into unix command in the awk script.
Could any body help me.
Thank you very much.
Now I have a file1 including:
fname:lname:email address(like xxxx@yahoo.com)
I want to email all users a message, the message is saved in file2.
I wrote:
nawk 'BEGIN{ FS=":"; n=1;
while (getline < "file2" > 0)
form[n++]=$0 }
{ print "Dear "$1,$2":" | "mail $3"
for ( i=1; i<n; i++)
{ msg=form
print msg | "mail $3" }
}' $file1
But "mail $3" doesn't work.
How can I pass the value of $3 into unix command in the awk script.
Could any body help me.
Thank you very much.