Last active
April 23, 2018 20:50
-
-
Save treywelsh/85a78368abd737bf0ab5f8fdecfc946e to your computer and use it in GitHub Desktop.
This file contains hidden or 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
subex ./ git log --oneline | |
NOTES: | |
git repository not tested | |
work only at first directory level | |
Could be useful with git aliases to run on a list of repos |
This file contains hidden or 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
#!/usr/bin/env bash | |
if [ $# -lt 2 ]; then | |
echo "USAGE: $0 directory command" | |
exit 1 | |
fi | |
DIR="$1"; shift | |
CMD="$@" | |
export CMD | |
find $DIR -mindepth 1 -maxdepth 1 -type d \ | |
| xargs -I {} -n 1 sh -c "echo {} \ | |
&& cd {} \ | |
&& $CMD \ | |
&& echo" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment