Skip to content

Instantly share code, notes, and snippets.

@tossmilestone
Last active May 31, 2017 03:03
Show Gist options
  • Save tossmilestone/6c3d66514008ab87595c81df81f943f1 to your computer and use it in GitHub Desktop.
Save tossmilestone/6c3d66514008ab87595c81df81f943f1 to your computer and use it in GitHub Desktop.
Recursively enter sub directories and execute command
#!/bin/bash
for dir in ./*; do
if [ -d "$dir" ]; then
echo "Entering ${dir} ..."
pushd ${dir}
eval "$1"
popd
fi
done
wait
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment