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 Answers 2

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.

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .