Guest User

Untitled

a guest
Jan 18th, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. #!/bin/bash
  2. files=$(find [directory_path] -maxdepth 3 -mindepth 2 -type f) # files found two to three levels into given directory path
  3. count=0
  4. throttle=10
  5.  
  6. for file in $files
  7. do
  8. count=$(($count+1))
  9.  
  10. # Do some action here, followed by a &
  11. # for example: mv $file test_$file &
  12.  
  13. let div="$count%$throttle"
  14. if [[ $div -eq 0 ]]
  15. then
  16. wait;
  17. fi
  18. done
Add Comment
Please, Sign In to add comment