Recursive bash loop array null -


i have function passing path. happens function setsub calls function testsub , under conditions testsub calls setsub different path.

here have far

shopt -s nullglob  function setsub() {     local assets=("$1"/*)        echo ${#assets[@]} ######### here     asset in "${assets[@]}";             if [ -d "$asset" ];             setsub "$asset"         fi;     done } 

the place marked 'here' outputs array length. problem whenever calls assets array 0. above sample should drill down , list number of items in directory. (what sample does, not whole script does)

it seems looking shopt -s dotglob test case had dot files in directory.

but after @l0b0 suggestion did bit of research , found this. after reading issues globing, thought best replace find


Comments