A lot of times (especially when working with kubernetes) happens that you need to extract certain arguments with one command and use them in the middle of another. A quick way to deal with it is through usage of xargs
with -I
arg.
For example:
kubectl get ns -o name | xargs -I "{}" kubectl label {}...