Skip to content

Instantly share code, notes, and snippets.

@miniharryc
Created May 24, 2017 22:42
Show Gist options
  • Save miniharryc/1d5b75cf702bdc1982ae8fc6399dee3b to your computer and use it in GitHub Desktop.
Save miniharryc/1d5b75cf702bdc1982ae8fc6399dee3b to your computer and use it in GitHub Desktop.
eachDir funcction
#
# 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