CSC209H5 Lecture 9: Signals
Document Summary
Csc209h5s - software programming and tools (winter 2018) The first tasks is to write a program called greeting that does nothing except run a infinite loop. #include int main () { while ( 1 ); return 0 ; Run your code in one window in the foreground. Kill it by typing control-c in the same window. Use ps to see that indeed it is still running. Use fg to move it to the foreground. Control-c is a signal to escape the program (break signal). ps -ax | grep a. out ps - process. Ax - all processes grep - grab all processes with a. out. S - used to send the signal used when killing. Task: open another window (on the same machine) and run ps again. Now that you know the pid use the kill command to kill it. There are a number of possibilities that will work and the command will depend on the pid of your running process.