NIT1202 Operating Systems UNIX Script Assignment 1: Part II Semester 2, 2017 For this assignment, you may work with one partner from the same lab, if desired. Objective: The aim of this assessment is to understand how to write basic menu driven bash scripts. Tasks: You are required to write a Bourne Again Shell Script (bash) to manage a menu driven program. When executed the user should be presented with a menu with 4 (four) options: 1. Print the following user information: the home directory, print files and folder in column format, user id, login shell together with the current date and time. 2. Write a bash script program that reads a set of positive integer numbers until a sentinel value is entered. Enter –99 as the sentinel value to terminate the loop. The idea of a sentinel controlled loop is that there is a special value (the "sentinel") that is used to say when the loop is done. In this example, the user will enter -99 to tell the program to terminate the loop. 3. Print out the sum, the highest number and the lowest number of the entered numbers. 4. Exit the program. Requirements: Your script must allow one of these options to be chosen at a time. The menu must be presented repeatedly, until the fourth option (exit) is chosen. An appropriate error message must be displayed if an invalid option is chosen. Option one, your script should list the specified environment variables - the home directory, print files and folder in column format, user id, login shell together with the current date and time. Option two should read a set of positive integer numbers until the sentinel value (-99) is entered. Option three should print the sum, the highest and the lowest number of the entered numbers. Option four should cause a graceful exit from the menu and the whole program. To Be Handed in: • A copy of your working bash shell script needs to be handed in to your tutor and uploaded in VU...
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here