I am trying to write a simple shell which accepts command line input and execute it as a background task.
How do I allow the child process to report to the parent process once it is completed, like the Bash shell?
user@user-desktop:~$ sleep 10 &
[1] 3729
user@user-desktop:~$ sleep 2 &
[2] 3730
user@user-desktop:~$
[1]- Done sleep 10
[2]+ Done sleep 2
Since this is your homework, I won’t give you full answer.
The GNU Glibc manual list the requirnment for job control shell. Let’s see if you can understand it.
Basically:
you have to change the control terminal to make jobs run in background
you have to handle
SIGCHLD(orwait) to monitor jobsAsk again after you have read it.