LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 08-26-2004, 12:33 PM   #1
marconi
LQ Newbie
 
Registered: Aug 2004
Posts: 1

Rep: Reputation: 0
Unhappy How to add subdirectories in PATH


Hi all!
I am relatively new to Linux, well this will probably be evident from my question. while writing a script I faced a problem of adding all the subdirctories of a certain directory in my path. I only know the way to add one directory at a time.
i.e.
export PATH=$PATH:ltp/kernel

but what I want to do is to add all the subdirectories of directory kernel in my path for successful execution of my program.

Please help me in this regard. Thanks in advance

Regards
MarcONI
 
Old 08-26-2004, 01:23 PM   #2
ToniT
Senior Member
 
Registered: Oct 2003
Location: Zurich, Switzerland
Distribution: Debian/unstable
Posts: 1,357

Rep: Reputation: 47
That sounds really strange that you want to put many entries to path.

Anyways, here it goes:
Code:
DIRS=`echo /foo/bar/baz/*`
export PATH=$PATH:${DIRS// /:}
That adds subdirectories of /foo/bar/baz/ to the PATH environment variable.
 
Old 08-27-2004, 02:15 PM   #3
LinuxLala
Senior Member
 
Registered: Aug 2003
Location: New Delhi, India
Distribution: Fedora 7
Posts: 1,305

Rep: Reputation: 45
hi marconi

Please take care of what forum you post your question in. This is the Linux-Certification forum, to discuss about the various certifications. There are many forums here at LQ. please choose the right forum so that your question gets the attention it deserves.

This post has been reported and will soon be moved to an appropriate forum so don't create a new thread.

Regards.
 
Old 08-27-2004, 03:27 PM   #4
XavierP
Moderator
 
Registered: Nov 2002
Location: Kent, England
Distribution: Debian Testing
Posts: 19,192
Blog Entries: 4

Rep: Reputation: 475Reputation: 475Reputation: 475Reputation: 475Reputation: 475
Moved: This thread is more suitable in Linux-General and has been moved accordingly to help your thread/question get the exposure it deserves.
 
  


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
Add path to @INC deus1 Linux - Software 0 07-27-2005 07:52 AM
How do I add library path? scc28y Linux - Newbie 5 03-18-2005 10:56 PM
add man path alaios Linux - General 2 03-14-2004 09:45 PM
How do I add something to my $PATH? iammeuno Linux - Software 1 12-18-2003 04:02 PM
appending PATH to automatically include subdirectories lyceum Linux - Newbie 2 08-20-2003 04:59 PM

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

All times are GMT -5. The time now is 12:16 AM.

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