Skip to content

Instantly share code, notes, and snippets.

@bigtiger
Created October 21, 2015 21:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bigtiger/220b65b8f84c76cc5068 to your computer and use it in GitHub Desktop.
Save bigtiger/220b65b8f84c76cc5068 to your computer and use it in GitHub Desktop.
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