Slackware This Forum is for the discussion of Slackware Linux.
|
| Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
11-11-2012, 01:29 PM
|
#1
|
|
Senior Member
Registered: Apr 2007
Location: Germany
Distribution: Slackware
Posts: 3,856
|
CDPATH not working
Hello,
I've read about CDPATH in this http://docs.slackware.com/howtos:sof...igation#cdpath Howto at SlackDocs. But it doesn't work here.
I've read the manpage for bash and think it should work like described in the Howto.
By default $CDPATH is not set, is this correct?
Now I have
Code:
CDPATH=$CDPATH:/tmp/
put in my .bashrc.
Code:
markus@samsung:~$ echo $CDPATH
:/tmp/
After sourcing .bashrc I thought that I could cd into directories in /tmp/ with only the name of the directory, but this doesn't work. I have also tried it with directories in my ~/ directory, this doesn't work as well.
Any Ideas?
Markus
|
|
|
|
11-11-2012, 01:49 PM
|
#2
|
|
LQ Veteran
Registered: Nov 2005
Location: London
Distribution: Slackware64-current
Posts: 5,087
|
Hi Marcus,
I think that the description entry in the wiki is misleading (although the examples are correct). My apologies. I'm going to clarify it right now.
You do not include the directories that you want to cd into. You include the parent directory.
From bash:
Quote:
|
This is a colon-separated list of directories in which the shell looks for destination directories specified by the cd command.
|
HTH
|
|
|
|
11-11-2012, 01:53 PM
|
#3
|
|
Senior Member
Registered: Apr 2007
Location: Germany
Distribution: Slackware
Posts: 3,856
Original Poster
|
Quote:
Originally Posted by sycamorex
Hi Marcus,
I think that the description entry in the wiki is misleading (although the examples are correct). My apologies. I'm going to clarify it right now.
You do not include the directories that you want to cd into. You include the parent directory.
From bash:
HTH
|
Thanks sycamorex for the quick reply,
I did this, I have for example several directories in /tmp/ named /tmp/build-ocaml, /tmp/build-trayer and so on (used for Slackbuilds). When I type the line is not expanded.
Markus
|
|
|
|
11-11-2012, 02:02 PM
|
#4
|
|
LQ Veteran
Registered: Nov 2005
Location: London
Distribution: Slackware64-current
Posts: 5,087
|
Weird. It works for me on 2 machines with stock Slackware 14 bash:
Code:
.bashrc
CDPATH=$CDPATH:/tmp/
Code:
echo $CDPATH
:/tmp/
Code:
ls /tmp
abc/ bcd/ cde/ def/ i3-sycamorex.cFpmeG/ plugtmp/
cd a[TAB] expands to abc.
|
|
|
|
11-11-2012, 02:06 PM
|
#5
|
|
Senior Member
Registered: Apr 2007
Location: Germany
Distribution: Slackware
Posts: 3,856
Original Poster
|
Is it possible that it has something to do with bash-completion? I don't have bash-completion installed.....
But otherwise referring to the manpage for bash, CDPATH should work like you described it.
It's really weird.
Markus
|
|
|
1 members found this post helpful.
|
11-11-2012, 02:23 PM
|
#6
|
|
LQ Veteran
Registered: Nov 2005
Location: London
Distribution: Slackware64-current
Posts: 5,087
|
I think you've nailed it. It looks like the CDPATH variable itself does not provide TAB completion. It will correctly cd into a said directory as long as you remember its exact name, eg:
Code:
cd build-trayer[Enter]
but to get the TAB completion you do need to install bash-completion.
|
|
|
1 members found this post helpful.
|
11-11-2012, 02:24 PM
|
#7
|
|
Senior Member
Registered: Apr 2007
Location: Germany
Distribution: Slackware
Posts: 3,856
Original Poster
|
Yup, that works.
Thanks for the clarification.
Markus
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 05:25 AM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|