Want ps -ef | grep erdp_ | awk '{print $ 2}' erdp_ acquired at the beginning of the process id, execution is ok in a terminal environment, but sh script which turned out to be more out of the two
root 11400 4280 0 17:08 pts/5 00:00:00 /bin/bash ./kill.sh erdp_system_app
root 11401 11400 0 17:08 pts/5 00:00:00 /bin/bash ./kill.sh erdp_system_app
root 11403 11401 0 17:08 pts/5 00:00:00 grep erdp_system_app
root 29942 1 3 12:22 pts/0 00:10:10 java -Xms512m -Xmx512m -Dfile.encoding=UTF-8 -DSERVER_PORT=8082 -jar erdp_system_app-2.0.0-SNAPSHOT.war linkServerPId
ps -ef | grep erdp_ | awk '{print $ 2}' | grep -v can come to the third line, but the first two lines is how come from?
Anyway, enough with the following command:
ps -ef | grep erdp_ | grep -v | grep -v filename
or:
ps -ef | grep erdp_ | grep -ve '(grip | / bin / bash)'
Reproduced in: https: //www.cnblogs.com/FlyAway2013/p/10858028.html