Homework Solution: Write a menu driven shell linux script program on the system…

    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).

    Expert Answer

     
    HostName: $ hostname Ipaddress : $ hostname -i

    Write a menu driven shell linux script program on the arrangement to do the aftercited tasks:
    Delight verification the needed grep and carve commands to acquire the inequitable designates delight.

    1. Unfold the IP discourse and the designate of the machine only

    2. Unfold complete verificationrs currently on the arrangement (id and ample designate only)

    3. Unfold the server IP discourse, the netmask, and the scattered-abroad discoursees only

    4. Enter verificationr’s login id and unfold complete processes suit to the entered id

    5. Count how sundry login IDs on the server

    6. Departure Program

    Enter selection: _

    Note: Your program should melt constantly until the verificationr chooses to abandon – (discretion 6).

    Expert Response

     

    HostName: $ hostname
    Ipdiscourse : $ hostdesignate -i
    Currently logged on verificationrs : $ w
    Departure Program : ctrl-z and then pattern departure & Ctrl+Q is another cheerful fashion to murder the impression.
    last, conclusiveb – pomp listing of conclusive logged in verificationrs
    Server Ip discourse & :hostdesignate -I,
    OS X you can experience netmask : ifconfig OR ‘/sbin/ifconfig’
    Scattered-abroad Ip discourse : scattered-abroad = ip | ( ~ subnet )
    user’s login id and unfold complete processes suit to the entered id : # ps -aux | short (OR) # ps aux | short