Guest User

Untitled

a guest
Jan 22nd, 2018
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.31 KB | None | 0 0
  1. recursive() {
  2. for d in *; do
  3. if [ -d "$d" ]; then
  4. (cd -- "$d" && recursive)
  5. fi
  6. dir=`pwd`
  7. pattern="*.xyz"
  8. file_count=$(find $dir -name $pattern | wc -l)
  9. if [[ $file_count -gt 0 ]]; then
  10. echo "Match found. Going to execute a command"
  11. #execute command
  12. fi
  13. done
  14. }
  15.  
  16. (cd /target; recursive)
Add Comment
Please, Sign In to add comment