LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 06-17-2003, 01:40 PM   #1
pioniere
Member
 
Registered: Dec 2002
Location: Vancouver Island, Canada
Distribution: Slackware
Posts: 46
Blog Entries: 1

Rep: Reputation: 15
Changing PATH on the fly in BASH scripts


I want to be able to add to my PATH when running a BASH shell script, but cannot get it to work. I have tried several different ways to achieve this from within a script, but none seem to work. I thought that (for example):

Code:
export PATH=${PATH}:~/bin
would work within the shell script, but it does not.

I have searched the forums and can find lots of information on how to set the PATH from within .profile, .bashrc, etc., but nothing on how to do it from within a 'normal' shell script.

If anyone could shed any light on this, I would appreciate it. Thanks.
 
Old 06-17-2003, 04:52 PM   #2
Hko
Senior Member
 
Registered: Aug 2002
Location: Groningen, The Netherlands
Distribution: Debian
Posts: 2,536

Rep: Reputation: 111Reputation: 111
Well, it does work on my computer, but I do remember having the same problem at one time. I can't get it to fail any more. Anyways, back then, I solved it this way:
Code:
export PATH=${PATH}:${HOME)/bin

Last edited by Hko; 06-17-2003 at 04:53 PM.
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
Changing resolution on the fly _wb_ Linux - Newbie 6 07-09-2003 11:11 PM
GTK 1.2 Changing labels on the fly The Yeti Lives Linux - Newbie 1 06-12-2003 02:30 AM
Changing Fb settings on the fly raypen Slackware 0 03-24-2003 10:01 AM
setting 'PATH" 'on the fly' .. ? purpleburple Linux - General 1 11-09-2002 11:49 AM
Changing Kernel on the fly NSKL Linux - General 1 06-07-2002 05:28 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

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