Scripts + Background Processing
Let's say I wanted to have 1 script run 3 scripts:
SCRIPT: /script1.sh /script2.sh /script3.sh echo "" | mutt -s "scripts all completed!" me@me.com Is there any way to make it so that I can run all 3 scripts simultaneously, therefore utilizing this computers 4 cores? The catch is that I'd want each script to be fully completed before the email is sent! |
Start each script with an & at the end of the command and then use the wait command.
|
I read the description of the wait command. What is a jobspec?
If I ran each command in the background (with &, as you said), and then just use "wait" after them all, will it wait for each process executed by the script to finish? That's what I think I gathered from that description... EDIT: I found my answer here, thanks for your help! http://www.lamolabs.org/blog/1724/on...-wait-command/ |
You'll want something like:
Code:
/script1.sh & Forrest |
Quote:
|
All times are GMT -5. The time now is 01:38 AM. |