Last active
March 1, 2016 20:46
-
-
Save jayme-github/04845e0b3447c4248790 to your computer and use it in GitHub Desktop.
docker exec bash shorthand with bash completion for container names
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
| function docker-shell(){ | |
| # $1 == container | |
| docker exec -ti "$1" env TERM=xterm bash -l | |
| } | |
| _docker-shell(){ | |
| local cur=${COMP_WORDS[COMP_CWORD]} | |
| __docker_complete_container_names | |
| } | |
| complete -F _docker-shell docker-shell |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment