PROJECT UNIX Project

profileMr. Goodman
1_5032787611677098797.doc

ASA College

Unix Operating System and Shell Programming (CIS270)

Instructor: Prof. Zoya Vidrak

Project.

Due on week14

Problem: Your assignment is to prepare a script that would accumulate your username, date and time, and your computer information into a log file. Then, as the part two, a case statement should be used in a loop to run several choices. Also, make sure an exit point must be provided in the script as well.

Instructions: Perform the following tasks:

Part 1

1. Login into your bash shell.

2. Create a shell script named yourname-script that would do:

A. redirect a string Student name is <your actual first and last name> into a file Log-file; (10 pts)

B. append the current date and time information to the file Log-file; (10 pts)

C. append the string “My terminal logical name is <your actual logical terminal name>” to the file Log-file; use the command tty. (10 pts)

D. learn the name of your machine using the command uname and append the string “My machine name is <the actual name>” to the file Log-file; (10 pts)

Part 2

A. read the input from the keyboard; (5 pts)

B. make the following selections: (50 pts)

· if this is choice one,

a. display the string ‘My files’ ;

b. perform the listing command on your directory;

c. append the result to the file Log-file;

· if this is choice two,

a. display the string ‘My directory’ ;

b. perform the viewing of current directory command ;

c. append the result to the file Log-file;

· if this is choice three,

a. display the string ‘Calendar of this month is <actual information using command cal>’ ;

b. append the result to the file Log-file;

· in all other choices,

a. display the string ‘Wrong choice’ ;

b. append the result to the file Log-file;

3. Make the script yourname-script executable and run it. (5 pts)

4. Submit your project. Use screen shouts for the results.

1