4

I've enabled apt-get in SUDO without password , and bash autocompletion for it need to be enabled as well , but how ?

If i try to source that file:
%> . /etc/bash_completion.d/apt
No command 'have' found, did you mean:
 Command 'vave' from package 'lipsia' (universe)
 Command 'havp' from package 'havp' (universe)
 Command 'haxe' from package 'haxe' (universe)
 Command 'dave' from package 'libhttp-dav-perl' (universe)
 Command 'save' from package 'atfs' (universe)
have: command not found
No command 'have' found, did you mean:
 Command 'vave' from package 'lipsia' (universe)
 Command 'havp' from package 'havp' (universe)
 Command 'haxe' from package 'haxe' (universe)
 Command 'dave' from package 'libhttp-dav-perl' (universe)
 Command 'save' from package 'atfs' (universe)
have: command not found
2

The function have() is defined in /etc/bash_completion, so it is not possible to execute /etc/bash_completion.d/apt in isolation.

I think you would need to run the command

. /etc/bash_completion

and it will then execute all the completion scripts in the /etc/bash_completion.d directory.

However, I'm not sure why you would need to do this anyway. On my systems (natty and oneiric) completion for apt-get already works with or without sudo.

0

From your prompt it seems that you are using zsh, is it true?

bash-completion, as the name says, is the completion for bash, so it is not guaranteed to work for other shells, though partially compatible with bash.

  • nope , it's bash – daisy Oct 7 '11 at 9:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.