LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 07-19-2004, 12:59 PM   #1
mfazi1612
LQ Newbie
 
Registered: Jul 2004
Posts: 7

Rep: Reputation: 0
manipulating $PATH variable


Hi all,

I set the $PATH variable using

set PATH = ..........

My question is how do i remove items from the $PATH variable and say, change their order?

Thanks

Last edited by mfazi1612; 07-19-2004 at 09:04 PM.
 
Old 07-20-2004, 12:18 AM   #2
osvaldomarques
Member
 
Registered: Jul 2004
Location: Rio de Janeiro - Brazil
Distribution: Conectiva 10 - Conectiva 8 - Slackware 9 - starting with LFS
Posts: 519

Rep: Reputation: 34
Man,
Your question has too many answers. Each one who posts here will give you one solution. If you want to change the order of the path for a specific script, may be the best is to put the preferred paths in front of the path list which you have. By the command you used as example, I suppose you are using C shell. I don't know its syntax to give you an example. But in bourne shell, from which bash is descendant, suppose I have this path:
PATH=/usr/bin:/bin:/usr/sbin:/sbin:.... and we want some script to look first in /sbin, but maintain all the search path, we would do:
PATH=/sbin:$PATH
We could compose an editor for the path, but we would spend too much effort before the task to be done.
 
Old 07-20-2004, 07:37 AM   #3
mfazi1612
LQ Newbie
 
Registered: Jul 2004
Posts: 7

Original Poster
Rep: Reputation: 0
Thanks for your reply.
 
Old 07-20-2004, 08:06 AM   #4
320mb
Senior Member
 
Registered: Nov 2002
Location: pikes peak
Distribution: Slackware, LFS
Posts: 2,577

Rep: Reputation: 48
Bash has certain words that are "built in" to it.........."set" and "unset" are just two of them............."export" is another built in word.

IF your doing something specific like building an LFS system......you'll need to set a $PATH variable to use on a temporary basis.......example

Code:
export $LFS=/LFS
as osvaldomarques said, there are many answers to your question...........
 
Old 07-20-2004, 11:22 PM   #5
osvaldomarques
Member
 
Registered: Jul 2004
Location: Rio de Janeiro - Brazil
Distribution: Conectiva 10 - Conectiva 8 - Slackware 9 - starting with LFS
Posts: 519

Rep: Reputation: 34
Hi 320mb,
I would want alert you your command has an extra dollar; you have to enter
Code:
export LFS=/LFS
The references to this variable will be obtained with this symbol
Code:
cd $LFS
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
PATH variable jk21 Linux - Newbie 1 09-28-2004 02:48 PM
$path variable ? moby Linux - Newbie 3 06-01-2004 03:18 PM
PATH Variable in Mandrake JoeDuncan Linux - Distributions 4 12-27-2003 01:05 PM
the path variable mjkramer Linux - Newbie 4 10-18-2003 07:18 AM
Manipulating the PATH variable. redgore Linux - General 2 07-11-2002 05:56 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 06:40 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