I have this bash code:
declare -a globalDir
#------------------------------#
#Code that fills globalDir array
#-----------------------------#
echo ${#globalDir[@]} #print globalDir lenght and I get 2
for element in $globalDir
do
echo "$element"
done
My problem is that the code does not show any element of globalDir even if it's lenght is 2