Showing posts with label complete. Show all posts
Showing posts with label complete. Show all posts

Thursday, October 25, 2012

linux: complete command

I have my .ssh/config with a lot of connection names. What would be better than to have auto complete with ssh <TAB> <TAB>

Added this line to my bash profile and I was good to go.

complete -W "$(awk '/^\s*Host\s*/ { sub(/^\s*Host /, ""); print; }' ~/.ssh/config)" ssh
man complete

There is a lot that human can do, for everything else there is [shell] script :)