#find takes up too much memory #find .... | while read f; do ... "$f"; done DIR="/home/hendry/pictures/" #/home/hendry/pictures/rekka/oulu #DIR=/home/hendry/projects/imagetrack/stay echo Adding pictures from $DIR chmod -R u+rwx $DIR || exit find $DIR -iname '*.jpg' -exec sh insert.sh '{}' \;