Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kevinhooke/3a7b7accbdf0488ccffc9ea4a9396df3 to your computer and use it in GitHub Desktop.
Save kevinhooke/3a7b7accbdf0488ccffc9ea4a9396df3 to your computer and use it in GitHub Desktop.
bash iterate through all dirs and execute some action in that dir
#/bin/bash
for d in *; do
if [ -d ${d} ]; then
echo $d
cd $d
// do something with $d here
cd ..
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment