CS 279 - Week 3 Lab - 9-5-12

Here are some commonly-used control character assignments:
*   ^C is often an INTERRUPT control character
    ([Intr] in the course text)

    *   tries to interrupt the foreground process 

    *   (it doesn't always work -- sometimes the program
        might intercept the interrupt for some special
        purpose)

    *   the process is no more after this; it isn't still
        one of your current jobs;

*   ^Z is a bit different - it more of a suspension 
    ([Suspend] in the course text)

    typically, you can resume a suspended process;

    (how? by putting % followed by the job number you
    want to resume, or typing fg to restart the most
    most recent background process, etc.)

*   ^U lets you cancel the line you're typing (at the shell!)

*   the Delete or Backspace key is often bound such that
    you can delete the most recently typed character
    in your current command
    
for filename expansion in the shell,
*  matches 0 or more characters,
?  matches exactly 1 character
(and we'll talk about more options tomorrow)

Unix SIGNALS

*   each signal has a numerical code and a name

1  SIGHUP   terminal hangup
2  SIGINT   terminal interrupt
3  SIGQUIT  terminal quit (with a memory dump in a file core)
9  SIGKILL  process killed
   ...notice that 9! I think that when you do the command
   kill -9  <processid>
   ... you are asking for SIGKILL...
13 SIGPIPE  broken pipe (writing when the reader has terminated)
14 SIGALRM  alarm clock interrupt
15 SIGTERM  software termination

*   programs such as kill normally use
    SIGTERM to kill another process (more on this in chapter 5)

    ...receiving process can catch it and choose to continue

    BUT a SIGKILL cannot be caught; (I think this is sent
    with kill -9); a process receiving a SIGKILL signal 
    is always killed although the kill may not always work

*   signals for job control

    for example:
    23  SIGCONT   continue job if stopped

    ...this is sent with fg, for example

    and there are more, too

    24  SIGSTOP  noninteractive stop signal
    26  SIGTTIN  read attempted by a background job
    27  SIGTTOU  write attempted by a background job

    SIGSTOP is a way to stop a *job* 
    by default, SIGTTIN and SIGTTOU stop a job that is 
        running in the background