You are not logged in.

#1 2007-07-31 07:27:03

geek.arnuld
Member
From: INDIA
Registered: 2007-05-03
Posts: 135
Website

BASH completion problem

i have "bash-completion" package installed but when i do this:

 $ xine

and press TAB, it does not show me list of files. sometimes it shows the files but most of the times it does not. same with all others commands:

 $ rm -v

here too it does not show any files, as i said sometimes it does but most of the times it does not. if i do

 $ cd

and press TAB then it always shows the directories,. never fails with directories but not the same with files.

what could be the problem ? i have no problems like this with ZSH.

Offline

#2 2007-07-31 07:35:55

somedrew
Member
From: Canada
Registered: 2007-05-14
Posts: 140

Re: BASH completion problem

Do you have the following in either your ~/.bashrc or /etc/profile?

if [ -f /etc/bash_completion ]; then
    . /etc/bash_completion
fi

Offline

#3 2007-07-31 10:27:16

geek.arnuld
Member
From: INDIA
Registered: 2007-05-03
Posts: 135
Website

Re: BASH completion problem

somedrew wrote:

Do you have the following in either your ~/.bashrc or /etc/profile?

if [ -f /etc/bash_completion ]; then
    . /etc/bash_completion
fi

no i do not. ok i will put it there. BTW, is that "dot" is 1st character in 2nd line of code:

          if [ -f /etc/bash_completion]; then
--->            ./etc/bash_completion
          fi
?

Offline

#4 2007-07-31 11:38:32

somedrew
Member
From: Canada
Registered: 2007-05-14
Posts: 140

Re: BASH completion problem

geek.arnuld wrote:

no i do not. ok i will put it there. BTW, is that "dot" is 1st character in 2nd line of code:

          if [ -f /etc/bash_completion]; then
--->            ./etc/bash_completion
          fi
?

The period in that context means to source /etc/bash_completion. You can always replace it with 'source' if you like (note: there needs to be a space between '.' and '/etc/bash_completion').
cheers,

Offline

#5 2007-07-31 11:48:36

geek.arnuld
Member
From: INDIA
Registered: 2007-05-03
Posts: 135
Website

Re: BASH completion problem

somedrew wrote:

The period in that context means to source /etc/bash_completion. You can always replace it with 'source' if you like (note: there needs to be a space between '.' and '/etc/bash_completion').
cheers,

that's good, source is better. i tried Google but i did not find how to make this bash_completion work on global level for all users. "~/.bashrc" addresses single user, not all. all the links i get from Google talk about either "/etc/bash/bashrc" or "/etc/bash....." and both of these are not present on Arch.

Offline

#6 2007-07-31 12:17:32

Cerebral
Forum Fellow
From: Waterloo, ON, CA
Registered: 2005-04-08
Posts: 3,108
Website

Re: BASH completion problem

geek.arnuld wrote:

that's good, source is better. i tried Google but i did not find how to make this bash_completion work on global level for all users. "~/.bashrc" addresses single user, not all. all the links i get from Google talk about either "/etc/bash/bashrc" or "/etc/bash....." and both of these are not present on Arch.

The bash-completion package sets this up for you with a small script in /etc/profile.d/bash_completion.sh

Offline

#7 2007-07-31 16:29:22

geek.arnuld
Member
From: INDIA
Registered: 2007-05-03
Posts: 135
Website

Re: BASH completion problem

Cerebral wrote:

The bash-completion package sets this up for you with a small script in /etc/profile.d/bash_completion.sh

so bash_completion is ON by default for all users ?

if yes, then what is causing my problem ?

Offline

#8 2007-07-31 16:54:51

Cerebral
Forum Fellow
From: Waterloo, ON, CA
Registered: 2005-04-08
Posts: 3,108
Website

Re: BASH completion problem

geek.arnuld wrote:
Cerebral wrote:

The bash-completion package sets this up for you with a small script in /etc/profile.d/bash_completion.sh

so bash_completion is ON by default for all users ?

if yes, then what is causing my problem ?

Well, if you haven't logged out, then logged back in, since installing bash-completion the script won't be sourced - that might be the problem (especially if adding the lines to your .bashrc fixed it.)

Offline

#9 2007-07-31 17:52:05

geek.arnuld
Member
From: INDIA
Registered: 2007-05-03
Posts: 135
Website

Re: BASH completion problem

Cerebral wrote:

[
Well, if you haven't logged out, then logged back in, since installing bash-completion the script won't be sourced - that might be the problem (especially if adding the lines to your .bashrc fixed it.)

mo, the problem is still the same. i have added those lines to my .bashrc and rebooted (as i went to market ;-) but that does not work sad

Offline

#10 2007-08-01 08:25:50

prim
Member
From: Wroclaw - Poland
Registered: 2006-05-10
Posts: 47

Re: BASH completion problem

You have to run bash as a login shell.
See http://bbs.archlinux.org/viewtopic.php?id=30205


Feel free to correct my English

Offline

#11 2007-08-01 18:04:34

geek.arnuld
Member
From: INDIA
Registered: 2007-05-03
Posts: 135
Website

Re: BASH completion problem

prim wrote:

You have to run bash as a login shell.
See http://bbs.archlinux.org/viewtopic.php?id=30205

well i used "chsh" to change my login shell to BASH and when i tried to this script:

if [[ -o login ]]; then
    echo "Welcomoe to BASH as login shell"
else
    echo "NOPE..... NOPE.... NOPE..NOPE"
fi

i always get "NOPE...NOPE...." sad

i use "rxvt-unicode" and my "~/.Xdefaults" file says this: 

! rxvt-unicode settings                                                                                                     
                                                                                                                             
urxvt*loginShell:               true                                                                                         
urxvt*saveLines:               10000           

i still do not undertsand my the tab-completion system doe snot work and why BASH is still not the login shell

Offline

Board footer

Powered by FluxBB