From 6b3c499d918c81c0f1e1f53846922b8b61a91e46 Mon Sep 17 00:00:00 2001 From: fangshunjian Date: Thu, 3 Jan 2019 15:47:03 +0600 Subject: 修改可以在页面配置 grep 过滤条件 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/com/nis/nmsclient/util/ProcessUtil.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/com/nis/nmsclient/util/ProcessUtil.java b/src/com/nis/nmsclient/util/ProcessUtil.java index 461a8d1..02deffc 100644 --- a/src/com/nis/nmsclient/util/ProcessUtil.java +++ b/src/com/nis/nmsclient/util/ProcessUtil.java @@ -1156,8 +1156,7 @@ public class ProcessUtil */ public static List 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; -- cgit v1.2.3