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 |