I know how to run a command in all subdirectories that match a pattern like this (lets say I want to run gh repo sync):
for d in ./*/ ; do (cd "$d" && gh repo sync) ; done And runs the commands in a subshell in each directory serially.
What I want is to run all the commands in parallel but wait in the main script for them to all finish.
I'm using Ubuntu 22.04. Is that possible?