logo

UNIX Script Assignment: Part 2 - NIT1202 Operating Systems

Write a Bourne Again Shell Script to manage a menu driven program that allows the user to print user information, generate random numbers, and exit the program.

9 Pages840 Words374 Views
   

Added on  2023-06-03

About This Document

This shell script generates different information such as home directory, path, userid, login shell with the current date and time, displays 8 random numbers between the range inputted by the user, prints out highest and lowest numbers of the eight random numbers generated and exits the program.

UNIX Script Assignment: Part 2 - NIT1202 Operating Systems

Write a Bourne Again Shell Script to manage a menu driven program that allows the user to print user information, generate random numbers, and exit the program.

   Added on 2023-06-03

ShareRelated Documents
Running head: NIT1202 OPERATING SYSTEMS
UNIX Script Assignment: Part 2
Trimester 2, 2018
Name of the Student
Name of the University
Author’s Note
UNIX Script Assignment: Part 2 - NIT1202 Operating Systems_1
1
NIT1202 OPERATING SYSTEMS
Table of Contents
1. Bourne Again Shell Script for the management of menu driven program......................2
1.1. Print the user information: the home directory, path, user id, login shell together
with the current date and time.....................................................................................................2
1.2. Shell program displaying 8 random number between the range inputted by the user
(Range difference of 100)............................................................................................................3
1.3. Printing out highest and lowest numbers of the eight random numbers generated. .4
1.4. Exit the program.......................................................................................................6
Bibliography........................................................................................................................7
UNIX Script Assignment: Part 2 - NIT1202 Operating Systems_2
2
NIT1202 OPERATING SYSTEMS
1. Bourne Again Shell Script for the management of menu driven program
1.1. Print the user information: the home directory, path, user id, login shell
together with the current date and time
#!/bin/bash
#Author's Name: Student
#Student_ID s12345
#Date: Oct 2018
#This script generates different information such as
# home directory, path, userid, login
# shell with the current date and time
# function for displaying a line of asterics
echo "Please choose any of the options"
option=("Option 1" "Option 2" "Option 3" "Option 4")
select option in "${option[@]}"
do
function ln(){
echo "*******************************"
}
UNIX Script Assignment: Part 2 - NIT1202 Operating Systems_3

End of preview

Want to access all the pages? Upload your documents or become a member.

Related Documents
NIT1202 Operating System | Assignment
|11
|832
|38

NIT1202 Operating Systems Sample Assignment
|10
|593
|75