用shell脚本编写有以下的功能: Syste Manage 1.show the user //显示登陆系统用户以及动作。 2.test the network //网络测试 3.show the TID //显示进程信息 4.kill the peocess //杀死进程 5.shoutdown the system //关机 6. reboot the system //重启 0.ecit //退出程序
#! /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