Created
November 16, 2017 13:52
-
-
Save T1T4N/de232136a42acdd0f6359073adc4e23b to your computer and use it in GitHub Desktop.
Snippet to check if an array is declared
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
#!/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