Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Write a script that creates three background processes, waits for them all to co

ID: 3629182 • Letter: W

Question

Write a script that creates three background processes, waits for them all to complete, and then displays a simple message. [level: medium]
Such a script will fork off three programs and then execute a wait command. This will cause the shell to sleep until all three programs have terminated. The next command after the wait command could be echo with a simple message.

Explanation / Answer

#!/usr/bin/env bash ping -c 5 google.com >& /dev/null & ping -c 5 yahoo.com >& /dev/null & ping -c 5 flickr.com >& /dev/null & wait echo "All pings have completed." ----------------------------------------------------------------------------- Please keep in mind: I am a college student too. I only do this for the karma points. I use the karma points to buy things I need as a supplement to financial aid. If you found this answer satisfactory, please give me the Lifesaver rating so that I get the full karma points for it. Thank you!

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote