LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 11-06-2004, 11:56 AM   #1
chunlee
Member
 
Registered: Jun 2004
Location: london
Distribution: gentoo
Posts: 114

Rep: Reputation: 15
removing one directory in PATH env


hi there:

i have just learn how to add directory to the existing enviromental variable by doing

PATH=$PATH:/newdirectory

but i can't seem to figure out how to remove a particular directory, can anyone help?

thanks

CHUN
 
Old 11-06-2004, 12:07 PM   #2
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 65
Just don't add it to the PATH variable or after it has been set just edit the variable to what you like..
 
Old 11-06-2004, 08:15 PM   #3
chunlee
Member
 
Registered: Jun 2004
Location: london
Distribution: gentoo
Posts: 114

Original Poster
Rep: Reputation: 15
thanks, so to remove a particular directory is to redifine all but the one i want to remove?

CHUN
 
Old 11-06-2004, 08:32 PM   #4
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,005
Blog Entries: 11

Rep: Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903
Yep ... why set it first and remove it later? :)

Just wouldn't make sense, would it?


If it's something you need changed once in a
blue moon you could probably
export PATH=`echo $PATH|sed 's/remove_me//'`



Cheers,
Tink
 
Old 11-06-2004, 08:50 PM   #5
chunlee
Member
 
Registered: Jun 2004
Location: london
Distribution: gentoo
Posts: 114

Original Poster
Rep: Reputation: 15
well, i set it to the wrong directory, that's why

CHUN
 
  


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 env Problems Coda Linux - Newbie 8 11-17-2004 07:04 PM
C shell and env $PATH vikinnun Programming 1 11-10-2004 10:02 PM
help - what env var for dynamic lib path? emanresu Linux - Newbie 3 05-31-2004 04:32 PM
Changing $PATH env variable alzogbi Linux - Newbie 2 03-26-2004 03:06 AM
RedHat 7.3 PATH env variable problem NewRedHatter Linux - Newbie 4 09-01-2002 06:14 AM


All times are GMT -5. The time now is 08:48 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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration