GTU OS Program - 7

7. Write a menu driven shell script which will print the following menu and execute the given task. MENU
1) Display calendar of current month
2) Display today’s date and time
3) Display usernames those are currently logged in the system
4) Display your name at given x, y position
5) Display your terminal number
6) Exit

Complete code of the program

i=0
while [ $i != 6 ]
do
echo "Menu
1. Display calender of current Month
2. Display today's date and time
3. Display usernames of those who are currently logged in the ststem
4. Display your name at given x, y position
5. Display Terminal Number
6. Exit
Choose your option and enter corresponding value"

        read i
        case "$i" in
                1) calender="$(cal)"
                        echo "Here is your Calender "
                        echo "$calender"
                        ;;
                2) current="$(date)"
                        echo "Current Date and Time is " "$current"
                        ;;
                3) username="$(whoami)"
                        echo "Currently logged in users : "
                        echo $username
                        ;;
                4)                         
                        ;;
                5) 
                        ;;
esac
done  

Code for the option 4 and 5 will be updated soon

Interpreting the menu_pr.sh file and executing it in terminal

tkanu025@hp:~/lab_solutions$ chmod +x menu_pr.sh
tkanu025@hp:~/lab_solutions$ ./menu_pr.sh
Output
cse gtu free study material for gtu engineering students operating system programs
cse gtu free study material for gtu engineering students operating system programs
cse gtu free study material for gtu engineering students operating system programs

gtu os lab manual,

os GTU Practical,

operating system Programs,

Operating system shellscript programs,

Gtu study material 3140705,

OS 3140702,

os practical list,

shell script programming,

gtu os practical,

os lab solution gtu

Comments

Parth shah said…
please can you share with me the whole code for practical 7?

YouTube

Popular posts from this blog

GTU OOP Program - 18

GTU OS Program - 3