Created
October 21, 2015 21:54
-
-
Save bigtiger/220b65b8f84c76cc5068 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
dosh() { | |
if [ "$1" = "-h" ] || [ "$1" = "--help" ] || [ "$1" = "help" ] | |
then | |
read -r -d '' VAR << EOM | |
Usage: dosh [argument] | |
Arguments: | |
ls (default) lists running containers | |
[name|id] runs bash for specified container | |
help, -h, --help brings up this help | |
EOM | |
echo "$VAR" | |
elif [ "$1" = "ls" ] || [ "$1" = "" ] | |
then | |
docker ps|grep gopro*|grep -v postgres|cut -d ' ' -f 1-10 | |
elif [ "$1" != "" ] | |
then | |
docker exec -i -t `docker ps|grep $1|cut -d ' ' -f 1` bash | |
fi | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment