4 karma · joined Jun 21, 2023 (3y ago) · 5 submissions
comment 3y ago · link · parent
Abbreviated example, getting the service names from a k8s cluster looks roughly like (actual command does a bit more processing):
kubectl get deployments -o wide | rev | cut -d'=' -f1 | rev
But if it's just gobbling whitespace, xargs without a command can be your friend.
$ echo "key: value" | cut -d: -f2 | xargs
value
My brain generally goes "rev sed head tail xargs cut tr ... screw it, I'll use python ... someday I shall learn awk." There's a young engineer on my team that knows awk, and I'm envious.
comment 3y ago · link · parent
comment 3y ago · link · parent