Last active
May 31, 2017 03:03
-
-
Save tossmilestone/6c3d66514008ab87595c81df81f943f1 to your computer and use it in GitHub Desktop.
Recursively enter sub directories and execute command
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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