修改可以在页面配置 grep 过滤条件

This commit is contained in:
fangshunjian
2019-01-03 15:47:03 +06:00
parent 56d71f261a
commit 6b3c499d91

View File

@@ -1156,8 +1156,7 @@ public class ProcessUtil
*/
public static List<String> getLinuxProcessId(String procSearchKey)
{
String cmd = "ps -ef | grep -i '" + procSearchKey.trim()
+ "' | grep -v grep | awk '{print $2}'";
String cmd = "ps -ef | grep " + procSearchKey.trim() + " | grep -v grep | awk '{print $2}'";
logger.info("getLinuxProcessId-----" + cmd);
String[] shellCmd1 = new String[] { "/bin/bash", "-c", cmd };
BufferedReader bReader = null;