I have the following command written to assign find results into an array, to delete files older than 7 days later. F_ARR[0]='' unset F_ARR find "$CDIR" ! -type d -mtime +7 -exec sh -c ' for pathname do F_ARR+=("$pathname") done ' sh {} + echo ${#F_ARR[@]} But
F_ARR[0]='' unset F_ARR find "$CDIR" ! -type d -mtime +7 -exec sh -c ' for pathname; do F_ARR+=("$pathname") done' sh {} + echo ${#F_ARR[@]} But, when I print the length of array F_ARR, it shows 0. Did I commit something wrong in code?