#!/bin/bash

# list all directories, cd into each, run `git pull`

# `find` lists only directories
# -`I %` replaces `%` with the argument in `sh -c`

find . -type d -mindepth 1 -maxdepth 1 | xargs -I % sh -c 'echo ----------; echo %; cd %; git pull'

#!/bin/bash

# list all directories, cd into each, run `git pull`

# `find` lists only directories
# `find ... -print0 | xargs -0 ...` is because of https://github.com/koalaman/shellcheck/wiki/SC2038
# -`I %` replaces `%` with the argument in `sh -c`

find . -type d -mindepth 1 -maxdepth 1 -print0 | xargs -0 -I % sh -c 'echo ----------; echo %; cd %; git pull'

Use `find -print0` because of SC2038
Use `find -print0` because of SC2038

$ shellcheck *.sh

In git-pull.sh line 8:
find . -type d -mindepth 1 -maxdepth 1 | xargs -I % sh -c 'echo ----------; echo %; cd %; git pull'
^-- SC2038: Use -print0/-0 or -exec + to allow for non-alphanumeric filenames.
