I've installed program
trickle that allow to throttle the net for specified command like:
trickle -u10 -d10 <COMMAND>
How to add bash completion for all binaries to
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It only takes a minute to sign up.Sign up to join this community
Do you have, and load, the file
/etc/bash_complete or an equivalent directory? It defines a bunch of completions and extension facilities beyond what's built into bash. If you have access to them, you can probably just use
complete -o filenames -F _command trickle
It will complete the first argument of trickle as a command, and will then try to apply appropriate completion rules for subsequent arguments. But it depends on the shell function
_command, which is defined in the above file (in my Debian system, at least). YMMV on other Linux distributions, and the file doesn't seem to be present in Darwin (OS X 10.8).
Actually there's an even simpler way to do this:
complete -c trickle
which will add completion of all available commands. If you wanted to do something fancy for the
-d etc. options there's some useful information here.
As an aside: the
man documentation for
complete is pretty understandable but it's buried way down in the enormous
bash manpage. The html version is much easier to get at.