Skip to content

Instantly share code, notes, and snippets.

@topahl
Created August 31, 2020 13:16
Show Gist options
  • Save topahl/b8607281b6ef171dac51e82c3bb14205 to your computer and use it in GitHub Desktop.
Save topahl/b8607281b6ef171dac51e82c3bb14205 to your computer and use it in GitHub Desktop.
This scipt lists all cf org id's with the corresponding org names.
#!/bin/bash
# list all org guids
# list of all Org names we need to iterate through
orgs=$(cf orgs | tail -n +4)
function get_guid() {
org=$1
echo "$org:"
# get org GUID
cf org "$org" --guid
echo ""
}
for org in $orgs
do
get_guid $org
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment