Linux menu Program

Source: Internet
Author: User
Linux menu-based program-general Linux technology-Linux programming and kernel information. The following is a detailed description. Author: lu_guang_yang

You can use shell scripts to write the following functions:
Syste Manage
1. show the user // display the login system user and action.
2. test the network // network test
3. show the TID // display process information
4. kill the peocess // kill the process
5. shoutdown the system // Shutdown
6. reboot the system // restart
0. ecit // exit the program
CODE :#! /Bin/bash
# Sh yan
While true
Do
Clear
Tput cup 2 24
Echo-n "system Manage"
Tput cup 3 24
Echo-n "*****************"
Tput cup 4 24
Echo-n "1. show the user"
Tput cup 5 24
Echo-n "2. tset the network"
Tput cup 6 24
Echo-n "3. show the PID"
Tput cup 7 24
Echo-n "4. kill the process"
Tput cup 8 24
Echo-n "5. shoutdown the system"
Tput cup 9 24
Echo-n "6. reboot the system"
Tput cup 10 24
Echo-n "0. exit"
Tput cup 11 24
Echo-n "*******************"
Tput cup 12 24
Echo-n "Please type in the option [0-6]:"
Read AA
Case $ AA in
1) w
;;
2) tput cup 13 24
Echo-n "qing shu ru ni yao ping de IP :"
Read BB
(Ping-c1 $ BB>/dev/null 2> & 1) & (tput cup 14 24; echo "OK! ") | (Tput cup 14 24; echo" Fail! ")
;;
3) tput cup 13 24
Echo-n "please type in the TID :"
Read CC
Ps-t $ CC
;;
4) tput cup 13 24
Echo-n "qing shu ru jing cheng hao :"
Read DD
Kill-9 $ DD
;;
5) init 0
;;
6) init 6
;;
0) exit
;;
*) Echo "cuo wu! "
;;
Esac
Read QQ
Done

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.