$ cat ~/bin/inall
#!/bin/sh
# runs given command (all arugments) in each directory of pwd
# example: in a workspace directory with many subfolders:
# $ inall git status
echo $@
for dir in ${PWD}/*
do
if [ -d $dir ]; then
echo ""
echo "$dir"
cd $dir && $@
cd - > /dev/null
fi
done
Very nearly the same, here's my "inall" script:
cool! neater than what I used!