bash: loop over directories
From stackoverflow:
for dir in /tmp/*/ # list directories in the form "/tmp/dirname/" do dir=${dir%*/} # remove the trailing "/" echo "${dir##*/}" # print everything after the final "/" done
From stackoverflow:
for dir in /tmp/*/ # list directories in the form "/tmp/dirname/" do dir=${dir%*/} # remove the trailing "/" echo "${dir##*/}" # print everything after the final "/" done