4.12 Menu shell script |
sh
or
the bash
shell.
If you wish you may do one of the scripts in the korn shell, ksh
or the tcsh
shell.
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.5: 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.
script
command.
username@gort ~ $
script Script started, file is typescriptusername@gort ~ $
menuscript ....username@gort ~ $
exit exit Script done, file is typescriptusername@gort ~ $
lpr typescript
script
makes a copy of the standard input to a the file
typescript so that it can be printed or saved.
Mark the print out your run results and a copy of your shell script with:
your name TABER CIS137 Lab 4.12: Menu Program
Remember to answer the question about if you could run your shell script within your shell script. Please turn your lab to Louis Taber or to Pima Community College employee in room A-115 of the Santa Rita Building. Ask them to place it in the dark blue folder in Louis Taber's mailbox.
4.12 Menu shell script |