How do I use GNU Parallel to run shellcheck on all *.sh with a wrapper function?
This attempt has the correct target files, but Parallel seems to struggle with the subshell.
lint:sh() {
local output
targets=$(find . -name '*.sh' -exec echo {} \;)
output=$(parallel --no-notice shellcheck ::: "$targets")
results $? "$output"
}
targetsto be an array.targets=($(find ...))then pass”${targets[@]}to GNU Parallel - Mark Setchellfind ... -exec echo {} \;seems overly verbose - try omitting-execand everything after. - Mark Setchellmapfile -t targets < <(find . -name '*.sh' -exec echo {} \;) output=$(parallel --no-notice shellcheck ::: "${targets[@]}")i get a non-zero exit but in the subshell not, lint:sh - results is not invoked - Tom