Just been mucking about with bash completion (had some time on my hands, OK?), and thought I'd share a couple of examples that fellow Slackers might find useful. DISCLAIMER: Or not.
Code: Select all
# Packages for installpkg
complete -o default -f -X "!*-*-*-*.tgz" installpkg
# Installed packages for removepkg
complete -W "$('ls' /var/log/packages)" removepkg
Add this to your ~/.bashrc, and tab completion will now work (fairly) intelligently for the {install,remove}pkg commands.
Anyone else got any top time-saving tips, completion-related or otherwise? This forum needs some traffic!