Created
January 11, 2014 21:44
-
-
Save coderofsalvation/8377369 to your computer and use it in GitHub Desktop.
Revisions
-
coderofsalvation created this gist
Jan 11, 2014 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,11 @@ # check if variable is array, returns 0 on success, 1 otherwise # @param mixed is_array() { #detect if arg is an array, returns 0 on sucess, 1 otherwise [ -z "$1" ] && return 1 if [ -n "$BASH" ]; then declare -p ${1} 2> /dev/null | grep 'declare \-a' >/dev/null && return 0 fi return 1 }