sh
or
the bash
shell,
and once
using the "C" shell csh
or the tcsh
shell.
If you wish you may do one of the scripts in the korn shell, ksh
.
l
) Do a ls
for the current directory with the options
last specified with loption.
loption
) Set the options for the above ls command.
cmd
) Run the shell script cmd
from a previous lab.
See Lab 4.4: Lab Editor 2 -- pico (or vi).
month
) Show the current month's calendar.
Use the cal
command without any arguments for this part.
compile
) Compile a "C" program. Do a second keyboard
read to get the name of the file to compile. Save this name for
future compiles so if your script receives a null input it can compile
the "current" file. You may want to consider handling
file names both with and without the ".c
" ending.
run
) Run a.out
the last "C" program compiled.
exit
) Exit the script.
tee
command.
menuscript | tee file-to-print-name
tee
makes a copy of the standard input to a file and also sends the
standard input to the standard output.
Print out your run results and a copy of your
shell script, then mark the "C" or tcsh
shell version with:
and the Bourne oryour name TABER CSC137 Lab 4.11: C or tcsh Shell Menu Program
bash
shell version with:
your name TABER CSC137 Lab 4.11: Bourne or Bash Shell Menu Program
Remember to answer the question about if you could run your shell script within your shell script. Place the lab in the instructor hand-in box in BUS R6E, the "terminal room".