From d5e2040cefa7be561bf3d79c2587599a74a56fd0 Mon Sep 17 00:00:00 2001 From: DjinnS Date: Sun, 25 Aug 2019 03:13:58 +0200 Subject: [PATCH] awk is useless because ps already formats the output. Also, this syntaxe isn't correct when the command is excuted on a container because of the ' . (#883) --- scan/base.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scan/base.go b/scan/base.go index 28f3ed3b..b7a0887d 100644 --- a/scan/base.go +++ b/scan/base.go @@ -729,7 +729,7 @@ func (l *base) detectWpPlugins() ([]models.WpPackage, error) { } func (l *base) ps() (stdout string, err error) { - cmd := `LANGUAGE=en_US.UTF-8 ps --no-headers --ppid 2 -p 2 --deselect -o pid,comm | awk '{print $1,$2}'` + cmd := `LANGUAGE=en_US.UTF-8 ps --no-headers --ppid 2 -p 2 --deselect -o pid,comm` r := l.exec(util.PrependProxyEnv(cmd), noSudo) if !r.isSuccess() { return "", xerrors.Errorf("Failed to SSH: %s", r)