requires
jq
CLI
oc get namespaces -o json | jq '[.items[] | select((.metadata.name | startswith("openshift") | not) and (.metadata.name | startswith("kube-") | not) and .metadata.name != "default" and (true)) | .metadata.name ]'
#!/usr/bin/env bash | |
# The MIT License (MIT) | |
# | |
# Copyright (c) 2023 Christian Haintz | |
# | |
# Permission is hereby granted, free of charge, to any person obtaining a copy of | |
# this software and associated documentation files (the "Software"), to deal in | |
# the Software without restriction, including without limitation the rights to | |
# use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of |
requires
jq
CLI
oc get namespaces -o json | jq '[.items[] | select((.metadata.name | startswith("openshift") | not) and (.metadata.name | startswith("kube-") | not) and .metadata.name != "default" and (true)) | .metadata.name ]'
#!/bin/bash | |
# stripping double quotes with sed | |
aws ecr describe-repositories | jq '.repositories[].repositoryName' | sed s/\"//g | |
# stripping double quotes with tr | |
aws ecr describe-repositories | jq '.repositories[].repositoryName' | tr -d '"' |