merge multiple shell scripts to one script


New Member

We have 4 shell scripts, which is generating reports and sending 4 different mails with attachments. I am trying to write a script, instead of sending 4 mails with all attached reports, need to send all the details/attachments in a single mail. Please find the attached script and suggest.




Well-Known Member
I haven’t had time to take a detailed look at all of the scripts, but it looks like each script performs a single task and sends an email.

Your script should perform each of the tasks the other scripts were doing and gradually build up the text for the final email. When all of the tasks are complete - email the results.

There’s a block of code at the start of all four scripts which checks a few things and sets some variables. That’s identical in all four scripts. So that block of code should probably go at the start of your final script.

Then do the task from script 1 and store the results, then tasks 2, 3 and 4. Build the text for the email as you go.
As soon as you’ve finished all four tasks - email the results.

I haven’t used ksh for years though. I’m more familiar with bash!

Members online