So hello,
I need to make a program where the process indefinitely writes three dots. When pressing CTRL-C (using SIGINT) the program needs to write the goodbye message and kill the process. When pressing CTRL-Z and then fg (using SIGCONT) the program need to measure the time which passed during this time in seconds and for every second that has passed the program needs to write one dot. When the program write all dots of one, it returns to three dots.
$ ./program
...
...
...
...
... <pressing Ctrl+Z>
$ <we wait few seconds (5)>
$ fg
.
.
.
.
.
...
...
...
...
<pressing Ctrl+C>
Ending
$
I managed to get through the first part (killing the process with CTRL-C while in infinity loop) but I can't find the way to measure the time after stopping the process with CTRL-Z and then continue with fg.
Can anybody help me, please?
Aucun commentaire:
Enregistrer un commentaire