bash completion for slack

Place to discuss Slackware
Post Reply
Posts: 32
Joined: Thu Jan 23, 2003 8:36 am
Location: Slackville

bash completion for slack

Post by Nobber »

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!

Post Reply