# exec:
# replaces current process with a specified command
# using exec, shell does not fork, and the command exec'ed replaces the shell
# used in script, forces an exit from the script when exec'ed command terminates

exec - "${SHELL##*/}"

command find -- "${HOME%/}"'/c/hooks' \
  -path "${HOME%/}"'/c/hooks/*/*' -prune -o \
  -path "${HOME%/}"'/c/hooks/*' \
  -type f \
  -exec sh -x -c -- 'command -p -- test -x "${1-}" && command -p -- cp -p -- "${1-}" ./.git/hooks' _ {} ';' 2>&1
