Instead of doing something like find . -type d -execdir ... \; you can run redo with the command you want to have executed recursively in the subdirectories of the working directory.
If Homebrew is installed, you can run this command:
brew install vbwx/utils/redo
completion/redo to a directory like /etc/bash_completion.d.completion/_redo to a directory like /usr/share/zsh/site-functions.redo to a directory such as /usr/bin.Run redo --help to get a quick overview of how to use this utility.
redo [--quiet] [--strict] [--follow] [--hidden] [--nocd]
[--mindepth N | +N] [--maxdepth N | -N] [--depth N | --N]
[--] [+INCLUDE_GLOB ...] [-EXCLUDE_GLOB ...]
[+] [DIR ...] [-] [SCRIPT_OR_EXECUTABLE [ARG ...]]
You can use the following variables in the script supplied to redo.
DIR: stringCWD: string (empty if --nocd is specified)ROOT: stringCOUNT: integerINDEX: integerRCOUNT: integerRINDEX: integerDEPTH: integerRUNS: integerFILES: integerSUBDIRS: integerLEAF: empty string or 1redo echo \$CWD
redo --nocd echo \$DIR # same result
redo echo \$PWD # absolute paths
redo --depth 2 --hidden -.git 'echo $INDEX: $DIR'
redo --2 --hidden -.git echo \$INDEX: \$DIR # same result
redo <<< 'echo "($DEPTH) $INDEX/$COUNT: $CWD"'
redo echo '"$CWD ($SUBDIRS directories, $FILES files)"'
redo --mindepth=2 --maxdepth=3 echo \$CWD
redo +2 -3 'echo $CWD' # same result
redo --quiet SetFile -a E '*.*' # executed in subdirectories recursively
redo --quiet . SetFile -a E '*.*' # also executed in working directory