Last active
June 8, 2021 01:25
-
-
Save rdmarsh/f6a55bc33fd0e0783926d61cad7f7b54 to your computer and use it in GitHub Desktop.
iterates over zabbix groups going to each higher parent lever
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
zc/one/two/three/four | |
zc/one/two/three | |
zc/one/two | |
zc/one |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/local/bin/bash | |
set -eu | |
group="zc/one/two/three/four" | |
while [[ "${group}" == *"/"* ]] ; do | |
echo "${group}" | |
group="${group%/*}" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment