C Shell Program
Connect to your virtual machine using ssh and complete the following tasks. Refer to assignment 1 for the commands to connect to and copy from your virtual machine.
Write a C Shell program that produces a menu driven program with the following six menu choices:
(a) allow the user to enter a C Shell command
(b) set the manual entry for a command
(c) show the calendar for a specfic month and year
(d) find out what type of information is stored in a file
(e) find the difference between two files
(f) quit the shell script program
The program should continually loop until the user selects to quit. After each option is selected, the user should be able to input the appropriate information to be able to execute the command requested. A partial sample run is shown below. Some information has been omitted.
Please select one of the following menu choices
a - issue a C Shell command
b - See the manual entry for a command
c - Show a calendar for a particular month and year
d - Find out what type of information is stored in a file
e - Find out the difference between two files
f - Quit this shell script
Enter your choice now - a
What is the command to be executed? ls
CheckReadAccess file2 marshaMenu subdir
brianMenu file3 readable typescript
checkAlias filep readable10:42 useForeach
checkRead florenceMenu readable11:00 useForeach2
createAlias getFileInfo rewadable useIf
createAlias-CSH holda reyMenu useShiftAgrv
data kithamMenu richardMenu useSwitch
daveMenu krisnMenu setdir2 useWhile
file mar shell1
file1 marshMenu shell2
Please select one of the following menu choices
a - issue a C Shell command
b - See the manual entry for a command
c - Show a calendar for a particular month and year
d - Find out what type of information is stored in a file
e - Find out the difference between two files
f - Quit this shell script
Enter your choice now - b
What is the manual command you would like to see? date
Reformatting page. Wait... done
Fortran Library Routines DATE(3F)
NAME
date - return date in character form
SYNOPSIS
subroutine date (str)
Please select one of the following menu choices
a - issue a C Shell command
b - See the manual entry for a command
c - Show a calendar for a particular month and year
d - Find out what type of information is stored in a file
e - Find out the difference between two files
f - Quit this shell script
Enter your choice now - c
What is the month? 7
What is the year? 1973
July 1973
S M Tu W Th F S
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30 31
Please select one of the following menu choices
a - issue a C Shell command
b - See the manual entry for a command
c - Show a calendar for a particular month and year
d - Find out what type of information is stored in a file
e - Find out the difference between two files
f - Quit this shell script
Enter your choice now - d
What is the name of the file? cshell1_orquidea_qinones
cshell1_orquidea_quinones: executable c-shell script
Please select one of the following menu choices
a - issue a C Shell command
b - See the manual entry for a command
c - Show a calendar for a particular month and year
d - Find out what type of information is stored in a file
e - Find out the difference between two files
f - Quit this shell script
Enter your choice now - e
What is the first file? file1
What is the second file? file3
1c1,2
< Wed Oct 30 22:23:40 EDT 2016
---
> 1d0
> < Wed Oct 30 22:23:40 EDT 2016
Please select one of the following menu choices
a - issue a C Shell command
b - See the manual entry for a command
c - Show a calendar for a particular month and year
d - Find out what type of information is stored in a file
e - Find out the difference between two files
f - Quit this shell script
Enter your choice now - f
Example execution:
.\myscript.sh > output.txt