LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
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
 
LinkBack Search this Thread
Old 01-31-2005, 02:09 AM   #1
gmitra
LQ Newbie
 
Registered: Jun 2002
Location: Slovak Republic
Distribution: RedHat, Mandrake, Gentoo
Posts: 25

Rep: Reputation: 15
export $PATH inside script


Hello,
Is it possible to export PATH variable inside a running script?
I want to use extended PATH in parent bash shell by the script.
Thanks
 
Old 01-31-2005, 06:44 AM   #2
Dark_Helmet
Senior Member
 
Registered: Jan 2003
Posts: 2,786

Rep: Reputation: 361Reputation: 361Reputation: 361Reputation: 361
No. There's no way a child process can affect the environment of the parent process. You'll need to directly issue the export command at the parent's prompt or source a file that contains the adjustments to PATH.
 
Old 01-31-2005, 08:04 AM   #3
gmitra
LQ Newbie
 
Registered: Jun 2002
Location: Slovak Republic
Distribution: RedHat, Mandrake, Gentoo
Posts: 25

Original Poster
Rep: Reputation: 15

Thx.
 
Old 02-01-2005, 08:34 AM   #4
bigearsbilly
Senior Member
 
Registered: Mar 2004
Location: england
Distribution: FreeBSD, Puppy
Posts: 3,048

Rep: Reputation: 95
no can do.
exports work down, not up.

you can always dot the file though.
then it would work. (mind your exit statements though)

Or define a func, in your .profile say, eg:

Code:
clear_path()
{
     export PATH=doh
}
that'll work.
bash and korn of course!
 
  


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
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
PATH export in etc/profile.local adds dir twice tongar Linux - Newbie 3 06-16-2005 03:56 PM
'export PATH' does not work lemuel Linux - Newbie 7 01-30-2005 11:39 AM
export PATH disappears twallstr Linux - General 4 12-13-2004 02:57 AM
export in a script movitto Linux - Software 3 08-27-2004 12:37 AM
'export' from a script doesn't work, why? sylvain_gnu Debian 3 04-20-2004 12:42 PM


All times are GMT -5. The time now is 04:28 AM.

Main Menu
 
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
Open Source Consulting | Domain Registration