Skip to content

Instantly share code, notes, and snippets.

@ikurni
Last active November 2, 2024 05:17
Show Gist options
  • Save ikurni/3875e9c43861dd26a0b384e5e60479ef to your computer and use it in GitHub Desktop.
Save ikurni/3875e9c43861dd26a0b384e5e60479ef to your computer and use it in GitHub Desktop.
Sample Nested Loop If
# for i in oc get project | grep -i -v '^openshift\| ^kube' | awk '{print $1}'; do for y in oc get pods -n $i | grep -i completed | awk '{print $1}'; do oc delete pods $y -n $i; done; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment