Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- files=$(find [directory_path] -maxdepth 3 -mindepth 2 -type f) # files found two to three levels into given directory path
- count=0
- throttle=10
- for file in $files
- do
- count=$(($count+1))
- # Do some action here, followed by a &
- # for example: mv $file test_$file &
- let div="$count%$throttle"
- if [[ $div -eq 0 ]]
- then
- wait;
- fi
- done
Add Comment
Please, Sign In to add comment