Hi Folks,
I have a shell script that processes some data and emails the results to a list of receipients. The email addresses are hard coded in the shell script.
I have written an awk utility to globally search and to replace certain email addresses with the new ones.
What I want to do is to update the original file (with the new email addresses) using my awk utility.
However, what I am getting is as follows
1, The original file is not updated
2, The utility prints the entire line where the change was made
3, If three changes are made on a line, the line is printed three times over.
Re-directing the output to a new file won't help because I will get the delta.
For starters, is awk the right tool for the job at hand ?
Can anybody suggest a work around (using awk) ? or a better tool to get the job done ?
PS: I don't know Perl. However, I am familiar with Korn shell and sed (a little bit)
Thanks in advance.
rogers42
I have a shell script that processes some data and emails the results to a list of receipients. The email addresses are hard coded in the shell script.
I have written an awk utility to globally search and to replace certain email addresses with the new ones.
What I want to do is to update the original file (with the new email addresses) using my awk utility.
However, what I am getting is as follows
1, The original file is not updated
2, The utility prints the entire line where the change was made
3, If three changes are made on a line, the line is printed three times over.
Re-directing the output to a new file won't help because I will get the delta.
For starters, is awk the right tool for the job at hand ?
Can anybody suggest a work around (using awk) ? or a better tool to get the job done ?
PS: I don't know Perl. However, I am familiar with Korn shell and sed (a little bit)
Thanks in advance.
rogers42