Skip to content

Instantly share code, notes, and snippets.

@T1T4N
Created November 16, 2017 13:52
Show Gist options
  • Save T1T4N/de232136a42acdd0f6359073adc4e23b to your computer and use it in GitHub Desktop.
Save T1T4N/de232136a42acdd0f6359073adc4e23b to your computer and use it in GitHub Desktop.
Snippet to check if an array is declared
#!/bin/bash
#DEST_DIRS=("" "")
if [[ -z ${DEST_DIRS[*]+_} ]]; then
DEST_DIRS=(
"dir1"
"dir2"
)
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment