Skip to content

Instantly share code, notes, and snippets.

@atemate
Created May 17, 2023 11:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save atemate/e293327e740c1b5636ecf598e275e2cb to your computer and use it in GitHub Desktop.
Save atemate/e293327e740c1b5636ecf598e275e2cb to your computer and use it in GitHub Desktop.
jq_get_unique_dirs.sh
modified_dirs='["a", "a/b", "b/c/d", "c/d/e.txt"]'
modified_dirs=$(echo $modified_files | jq -r '[ .[] | split("/") | .[0] ] | unique')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment