Skip to main content
2 of 3
added 241 characters in body
Dani_l
  • 5.2k
  • 2
  • 21
  • 34

Use find

export -f myshellfunc find . -mindepth 1 -maxdepth 1 -type f -name '*.zip' -exec bash -c 'myshellfunc "$0"' \; 

You MUST export your shell function with export -f for this to work. Now find executes bash which executes your shell function, and remains at the current dir level only.

Dani_l
  • 5.2k
  • 2
  • 21
  • 34