You are not logged in.

#1 2008-11-07 09:33:14

gnur
Member
Registered: 2008-11-04
Posts: 6

[solved] tab completion on bash alias

Hello everybody,

I got my install up and running smile.
But now I am trying to improbe productivity by adding a simple command:
cd %1 && ls

I got it working by making it like this:

cc () {
    cd $* && ls
}

This works exactly as I want it. But it doesn`t have tab completion!
Is it possible to enable this?

(if I change the function name to cd it does have tab completion but it goes in an endless loop, learnt that the hard way)

Last edited by gnur (2008-11-07 15:40:55)

Offline

#2 2008-11-07 11:40:09

Procyon
Member
Registered: 2008-05-07
Posts: 1,819

Re: [solved] tab completion on bash alias

I tried it out and it seems to work fine.

Offline

#3 2008-11-07 12:20:08

filou.linux
Member
From: Zurich
Registered: 2008-04-17
Posts: 87

Re: [solved] tab completion on bash alias

erm... do you have bash-completion installed and configured (in .bashrc)?

Offline

#4 2008-11-07 12:57:01

Dieter@be
Forum Fellow
From: Belgium
Registered: 2006-11-05
Posts: 2,001
Website

Re: [solved] tab completion on bash alias

Hmm.. you think typing c<tab><tab><tab><tab><tab><tab>... will be faster then typing cc?
There are a lot of commands that start with c...

Other then that, it should work yes.  I think you don't even need the bash-completion package. built in tab-completion should do afaik.


< Daenyth> and he works prolifically
4 8 15 16 23 42

Offline

#5 2008-11-07 15:15:12

gnur
Member
Registered: 2008-11-04
Posts: 6

Re: [solved] tab completion on bash alias

I think i should have been more clear.
I meant the completion wasn't working for the folder names.
So cc /ho<tab> won't give me home, it doesn't do anything at all.

//edit: it seems that restarting X gave me they joy of it working.

Last edited by gnur (2008-11-07 15:40:07)

Offline

Board footer

Powered by FluxBB