On Thu, 11 Jan 2024, Michael Ewan wrote:
Perl for the win.
Michael, As I thought more about my need I recognized that a more comprehensive scripting language than sed or awk was needed. I don't know perl, so I'm developing a python script that's more comprehensive. My end result is a script that replaces a saluation marker at the top of a message file with the recipient's name, then pipes the result to the email address of the recipient. Rinse and repeat for all recipients. One way to do this is to read the first line in the file (a name) and write that to an external file, salutations.txt. Then read the second line (an email address) and write that to another external file, addresses.txt. The following line is blank so it's skipped. The two files would then be processed using sed and piped to mailx. Another way is to skip the external files and add the salutation to the message and send that to the email address all in one fell swoop. I think that's the better way. But, it's been a long time since I wrote a Python script so this will take me a while to do I'm sure that Perl and other scripting languages will do the same job, but Python is the only one I've used for a couple of decades when I stopped writing in C. Thanks again, Rich