Bash script for loop with find and many directories

view story

http://unix.stackexchange.com – I'm writing a bash script to do some work on a directory that contains many (100,000+) sub-directories. Is there a predefined limit to how many arguments you can pass to a for loop such as the following? for dir in $(find . -type d) do # My code done I'm worried the script will bork if the find command returns too many directories. (HowTos)