Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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
share|improve this question

2 Answers 2

up vote 2 down vote accepted

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.

share|improve this answer

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.

share|improve this answer
    
nope , it's bash –  warl0ck Oct 7 '11 at 9:16

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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