Skip to content

Instantly share code, notes, and snippets.

@rdmarsh
Last active June 8, 2021 01:25

Revisions

  1. rdmarsh revised this gist Jun 8, 2021. No changes.
  2. rdmarsh created this gist Jun 8, 2021.
    4 changes: 4 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,4 @@
    zc/one/two/three/four
    zc/one/two/three
    zc/one/two
    zc/one
    10 changes: 10 additions & 0 deletions zabbix pop parent groups
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,10 @@
    #!/usr/local/bin/bash

    set -eu

    group="zc/one/two/three/four"

    while [[ "${group}" == *"/"* ]] ; do
    echo "${group}"
    group="${group%/*}"
    done