Exercise (10 Minutes)
Kill Processes
1. Create the /home/student/bin directory.
2. Create the output script file in the /home/student/bin
directory. Press the i key to enter Vim interactive mode. The
file must have the following content as shown. Use the :wq
command to save the file.
#!/bin/bash
while true; do
echo -n "$@ " >> ~/outfile
sleep 5
done
3. Make the output script file executable.
4. Start three processes with the output script file, by
passing the network, interface, and connection arguments.
Start the processes in the background. (Use & to start
process in background)
5. Open another terminal shell, verify that all three processes
are appending content to the /home/student/outfile file.
6. In the first terminal shell, list existing jobs.
7. Use signals to suspend the instance & network process.
Verify that the instance & network process is set to
Stopped. Verify that the network process is no longer
appending content to the ~/outfile file. (Use SIGSTOP signal
to suspend processes)
8. Terminate the instance & interface process. Verify that
the instance & interface process disappeared. Verify that
the instance & interface process output is no longer
appended to the ~/outfile file. (Use SIGTERM signal to
suspend processes)
9. Terminate all the remaining jobs. Verify that no jobs
remain and that output is stopped.