#/bin/Bashhint () {Read-P"Press Enter Tocontiune:"}check_a () {PS-ef |grepCxiang|awk '{for (i=1;i<=7;i++) $i = "";p rint}'<Text1//use grep and awk to filter the process into Text1. sed '/^.*/s///g'Text1 >text3//delete Text1 in front of empty row in Text3grep-VWF Text3 Text2//Statistics TEXT3 There are no rows in the Text2, so you can find out what those processes are not. Note: Text2 is a standard process fileRM-RF Text1 Text3} Check_b () {PS-ef |grepCxiang|awk '{for (i=1;i<=7;i++) $i = "";p rint}'<Text1sed '/^.*/s///g'Text1 >Text3grep-vWF Text3 Text2RM-RF Text1 Text3} Check_c () {PS-ef |grepCxiang|awk '{for (i=1;i<=7;i++) $i = "";p rint}'<Text1sed '/^.*/s///g'Text1 >Text3grep-vWF Text3 Text2RM-RF Text1 Text3} whileture//Menu making DoClearEcho "############################################"Echo "1. Check a device process" Echo "2. Check the B device process" Echo "3. Check the C device process"Echo "4. Exit the program"Echo "############################################"Read-P"Please enter the device process number to be checked:"U_select Case$U _selectinch 1) check_a HINT;; 2) Check_b HINT;; 3) Check_c HINT;; 4) exit;; *) Read-P"Please Select 1-3,press Enter to contine:"Esac Done
The server for production deploys a number of standard services that can be quickly monitored with this script when we are done deploying. The main use of standard process files with the native process files, grep comparison to find out the difference.
A shell script that you wrote to patrol the Linux process