Write a linux shell program to perform a menu driven program to display today’s date,Processes of the system,user’s of the system,list files of the system

Write a menu driven program to display today’s date,   Processes of the system,  user’s of the system,  list files of  the system


Code:

clear 
echo --------------------------------------------- 
echo '\tMenu Implementation' 
echo --------------------------------------------- 
echo 1.Today DATE 
echo 2.Process of the system 
echo 3.Users of the system 
echo 4.List of files 
echo Enter your choice 
read choice 
case $choice in 
        1)date;; 
        2)ps;; 
        3)who;; 
        4)ls -1;; 
        *)echo This is not a choice 
esac 

Output:

--------------------------------------------- 
Menu Implementation 
--------------------------------------------- 
1.Today DATE 
2.Process of the system 
3.Users of the system 
4.List of files 
Enter your choice 
  PID TTY          TIME CMD 
 2458 pts/0    00:00:00 bash 
 2477 pts/0    00:00:00 sh 
 2479 pts/0    00:00:00 ps 

14 comments:

Powered by Blogger.