aptitude & bash completion

Michael Bach (gmx) bach.michael at gmx.net
Tue Apr 17 15:58:40 UTC 2007


Hi all,
I use the c(k)onsole quite a lot. I have a normal user konsole and a 
root konsole. In the normal user konsole I have settings for completion:

[mike at miami][~]
$  set | grep complet
BASH_COMPLETION=/etc/bash_completion
BASH_COMPLETION_DIR=/etc/bash_completion.d
         if complete -p $cmd >&/dev/null; then
             cspec=$( complete -p $cmd );
                     cspec=${cspec#complete};
_complete ()
             COMPREPLY=($( complete -p | sed -e 's|.* ||' | 
         grep "^$cur" ));
     xspec=$( sed -ne '/^complete .*[    ]'${1##*/}'\([  ]\|$\)/{p;q;}' 
           $BASH_COMPLETION );
                             # remove word from list of completions
     case "$(complete -p ${1##*/} 2> /dev/null)" in
                            # remove word from list of completions
[mike at miami][~]

On the root konsole, the same command produces nothing:

root at miami:~# set | grep complet
root at miami:~#

Only, I have no idea why bash gets the completion information for a 
normal user but not for root.

Mike


Art Alexion wrote:
> Thanks to help from this people on this list, my switch from apt-get to 
> aptitude seems to be working fine now.
> 
> One thing I am not getting (Dapper) is bash completion with aptitude like I 
> got with apt-get.
> 
> Ex.
> 'sudo apt-get i<tab>' results in 'sudo apt-get install'
> 'sudo apt-get install bas<tab><tab> results in presenting me with choices of 
> packages begining with 'bas'
> 
> None of this works with aptitude.
> 
> Dapper comes with bash-3.1-2ubuntu10
> 
> The current version of bash seems to support aptitude (see 
> http://www.caliban.org/bash/index.shtml#completion).  
> 
> Is there a way to update my version of bash to support this?  I don't mind 
> hand patching the file as long as I know what to add.
> 




More information about the kubuntu-users mailing list