CS 141 Homework Assignment #12


In class graded exercise   
   Most students finished this exercise in class #9 on 10/25/07.

review p 110.

login to our class system using your 3 char login.

cal > junk
date > junk   # note no warning about overwrite

set -o noclobber   # note bad option(s) error 
      since Bourne shell does not support this

ksh      # to start a Korn shell session
     # your bourne shell will sleep until this is done

ps -f    # PID is the process id #
         # PPID is the parent process id #
         Note that both sh and ksh are running for your session.
         Note which is the parent and which is the child process.

$ ps -f
     UID   PID  PPID  C    STIME     TTY        TIME CMD
stevemor 14605 14603  0 19:52:14   ttyp9    00:00:00 -sh
stevemor 14683 14605  2 19:53:25   ttyp9    00:00:00 ksh
stevemor 14685 14683  1 19:53:32   ttyp9    00:00:00 ps -f

       Above is what my session showed.
       -sh is the Bourne shell. Its PID is 14605.
       ksh is the Korn shell. Its PID is 14683.
       The PPID for ksh is 14605 which is the Bourne shell,
       i.e. the Bourne shell is the parent process
       and ksh is the child process.

set -o    # to see all the options and if they are on or off

set -o noclobber

set -o    # note that noclobber is now on

date > junk  # should give an error

set +o noclobber

set -o | pg   # note that noclobber is now off

to get credit for this assignment,
turn noclobber back on
redirect to an existing file
show me the error on your screen.
Also show me all your current shell options which should include noclobber.

exit     # will end your ksh session and resume the bourne shell

ps -f    # note the ksh is no longer running