From the course: Learning Linux Shell Scripting
Unlock the full course today
Join today to access over 24,800 courses taught by industry experts.
Solution: Watch a script - Linux Tutorial
From the course: Learning Linux Shell Scripting
Solution: Watch a script
- [Instructor] How did you do with the challenge? The solution is to start the delay script using the backgrounder operator, the ampersand. It will reveal the delay script's PID before going to sleep. So we're gonna do a ./delay.sh, say 20 seconds and put the ampersand in there to send it to the background. There it goes, it gave us its ID, so we're gonna do ./prop.sh 25249 and it tell us it's watching that PID, any second now and there we go. We see that our delay script has woken back up with the we are awake now message and then our proc has noticed that it's terminated and say process 25249 has terminated and so, we are able to watch a script with another script.
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.