Write a menu driven shell linux script program on the system to do the following
ID: 3882419 • Letter: W
Question
Write a menu driven shell linux script program on the system to do the following tasks:
Please use the needed grep and cut commands to get the specific names please.
1. Display the IP address and the name of the machine only
2. Display all users currently on the system (id and full name only)
3. Display the server IP address, the netmask, and the broadcast addresses only
4. Enter user’s login id and display all processes belong to the entered id
5. Count how many login IDs on the server
6. Exit Program
Enter selection: _
Note: Your program should run forever until the user chooses to quit - (option 6).
Explanation / Answer
HostName: $ hostname
Ipaddress : $ hostname -i
Currently logged on users : $ w
Exit Program : ctrl-z and then type exit & Ctrl+Q is another good way to kill the application.
last, lastb - show listing of last logged in users
Server Ip address & :hostname -I,
OS X you can find netmask : ifconfig OR '/sbin/ifconfig'
Broadcast Ip address : broadcast = ip | ( ~ subnet )
user’s login id and display all processes belong to the entered id : # ps -aux | less (OR) # ps aux | less
If any doubts please feel free to reach me
Thanks in advance
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.