LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 11-15-2010, 02:26 PM   #1
dvno00
LQ Newbie
 
Registered: Jul 2008
Posts: 2

Rep: Reputation: 0
Tab-Completion in bash indexing system folders!


hi,

i shall first state my problem:

tab-completion indexes system folders (like /usr/bin, /usr/local/bin)! so say i'm in a folder that has two files, 'text' and 'myprog', i type in an 'm' then tab, and i get hundreds of results including 'mysql', 'mysqlconfig', and others as im sure you can imagine. is there a way to set it to default or something else that will only make it index the current folder?

now here's how i managed to cock it up if it helps...

i tried changing my PATH variable so i could execute programs in the current directory without './' - what i added to PATH was ':.' at the end (apparently this is not the way to do it... :S). i tried resetting PATH various times ('unset PATH', 'PATH=$whatever...') but this has not fixed the problem.

using 'unset PATH', of course, removes everything from PATH, which meant that functions (like 'ls') in /usr/bin and /usr/local/bin can't be found. obviously i want those to be found, but i would rather not tab through them!

thank you very much if you can help, and i'm very sorry if there is something i have overlooked that answers this (i did search!)
 
Old 11-15-2010, 05:04 PM   #2
Snark1994
Senior Member
 
Registered: Sep 2010
Distribution: Debian
Posts: 1,632
Blog Entries: 3

Rep: Reputation: 346Reputation: 346Reputation: 346Reputation: 346
How did you add "." to PATH? Did you do it in your .bashrc? Because then it will reset PATH to "$PATH;." everytime you log on...

I'm not on my Linux machine right now, but http://www.debian-administration.org/articles/316 suggests that it's done from /etc/bash_completion and /etc/bash_completion.d/, so maybe have a look around in those
 
Old 11-15-2010, 11:02 PM   #3
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
Quote:
Originally Posted by dvno00 View Post
i tried changing my PATH variable so i could execute programs in the current directory without './' - what i added to PATH was ':.' at the end (apparently this is not the way to do it... :S). i tried resetting PATH various times ('unset PATH', 'PATH=$whatever...') but this has not fixed the problem.
I'm curious; what did the person who said it's
"(apparently this is not the way to do it... :S)"
suggest to do instead?

While I agree that it's practically NEVER a good idea
for root, and a certain risk for ordinary users, I'd
say it's reasonable enough when used with care, e.g.,
not in world-writable places like /tmp ...


Cheers,
Tink
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Still getting to know Bash, question about tab-completion kaldrenon Linux - Newbie 5 12-19-2008 08:51 AM
no tab completion maddocks AIX 2 12-27-2007 01:10 PM
Tab-completion kzr_merchant Programming 2 12-17-2007 04:00 PM
Tab-Completion in bash script Buto Linux - General 1 12-04-2007 06:50 PM
filetype aware tab completion bash gearoid_murphy Linux - General 2 10-29-2006 06:52 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 10:13 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration