Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- recursive() {
- for d in *; do
- if [ -d "$d" ]; then
- (cd -- "$d" && recursive)
- fi
- dir=`pwd`
- pattern="*.xyz"
- file_count=$(find $dir -name $pattern | wc -l)
- if [[ $file_count -gt 0 ]]; then
- echo "Match found. Going to execute a command"
- #execute command
- fi
- done
- }
- (cd /target; recursive)
Add Comment
Please, Sign In to add comment