How to redirect a k8s "exit code 137"?

8/8/2019

I'm killing a process inside a pod with command:

kubectl  exec ${pod} -- bash -c "kill -9 \`ps -ef | grep ${something} | grep -v grep | awk '{print \$2}'\` >/dev/null 2>&1" >/dev/null 2>&1

and I get "command terminated with exit code 137" message that indicates that process ${something} was really killed. How can I redirect the exit code?

-- NZL
bash
kubernetes
redirect

1 Answer

8/8/2019

Running the Process:

kubectl --namespace=magellan exec $pod 2>/dev/null -- bash -c "some remote command"

And after it killing the process does not redirect the error to screen

-- NZL
Source: StackOverflow