LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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-09-2002, 12:18 PM   #1
purpleburple
Member
 
Registered: Jun 2002
Location: USA
Distribution: Slackware8.1
Posts: 332

Rep: Reputation: 30
setting 'PATH" 'on the fly' .. ?


Hi. If I want to append say a directory to PATH just while I am in an xterm how do I set the PATH?

I did this to add /home/bin to my PATH
PATH=/home/bin

and then things like 'ls' etc didn't work. I understand WHY they didn't work was because PATH was changed to only '/home/bin'.

someone had something like this to set PATH on the fly at the prompt
It isn't correct but it's as close to what I can remember as I can't find
where I read it. Basically the {PATH} part is a shortcut to retyping the entire
old path when appending the new one.

PATH={PATH}:/home/brian

thanks

Last edited by purpleburple; 11-09-2002 at 12:20 PM.
 
Old 11-09-2002, 12:49 PM   #2
leed_25
Member
 
Registered: Jul 2002
Location: san francisco
Distribution: freebsd
Posts: 102

Rep: Reputation: 17
assuming that you're using an sh compatible shell, like ksh, or bash, you would do it like this:

export PATH=$PATH:/home/bin

actually, I would be more inclined to search my home directory first, like this

export PATH=/home/bin:$PATH

not that I would even do this by hand --but I can understand the occasional need.

Last edited by leed_25; 11-09-2002 at 12:54 PM.
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
Stdout And Stdin: Can't get it to do it "on the fly"... Eskild Programming 4 07-19-2005 01:41 PM
Cedega and Fat32 (Invalid path "." given for "--use-dos-cwd") bdox Linux - Games 0 03-26-2005 03:48 AM
Hard drive lose dma "on the fly" Hammett Linux - Hardware 4 08-23-2004 02:38 PM
Changing PS1 "on the fly" for root gandalf2041 Linux - General 1 11-22-2003 02:37 PM
Changing PATH on the fly in BASH scripts pioniere Programming 1 06-17-2003 05:52 PM

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

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