Last active
May 3, 2017 08:14
-
-
Save liorrozen/8344368 to your computer and use it in GitHub Desktop.
Alias "can-haz" to "sudo apt-get" allowing you to run commands like "can-haz apache2".
This file contains 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
alias can-haz="sudo apt-get install" | |
# Autocomplete function | |
_can-haz() { | |
cur=`_get_cword` | |
COMPREPLY=( $( apt-cache pkgnames $cur 2> /dev/null ) ) | |
return 0 | |
} | |
complete -F _can-haz can-haz |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment