I am trying to get the bash
output to a variable and then hide
the output afterwards in the command itself.
I could find a way to hide the output using /dev/null 2>&1
at the end of the command like below:
kubectl get deployments -n kube-system | grep minions /dev/null 2>&1
It hides the output, but I need to get its output to a variable and then hide it (so I will still have the output but command wouldn't show the output in terminal)
How can I do this?