Created
May 24, 2017 22:42
-
-
Save miniharryc/1d5b75cf702bdc1982ae8fc6399dee3b to your computer and use it in GitHub Desktop.
eachDir funcction
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
# | |
# quick command line alias to do something to each directory under | |
# the current path | |
# | |
# For example: | |
# | |
# > eachDir "git status" | |
# | |
func_Each_dir() { | |
for D in ./*; do | |
if [ -d "$D" ]; then | |
echo $D | |
cd "$D" | |
eval $1 | |
cd .. | |
fi | |
done | |
} | |
alias eachDir=func_each_dir |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment