Visit Jeremy's Blog.
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.


  Search this Thread
Old 11-01-2006, 03:15 PM   #1
LQ Newbie
Registered: Aug 2006
Posts: 15

Rep: Reputation: 0
Shell Script Exporting Issue

I'm writing a script in shell and, in the script, I use
the export command multiple times to set some environment
variables. Though, when I run the script the values are
never set.

Pertinent information:

Script interpreter = #!/bin/sh

user shell = bash

example of export command:

export TEST2=15

Any ideas? thanks.
Old 11-01-2006, 04:18 PM   #2
Senior Member
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,138

Rep: Reputation: 168Reputation: 168
It sound like you're running the script in its own sub-shell. For example:
If you source the script from the current shell, the exported variables should be available:
source /path/to/script/
. /path/to/script/


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
ftp'ing via shell script issue closet geek Programming 6 09-20-2006 09:11 AM
Exporting to a super shell sggrubb Linux - General 1 02-18-2003 10:34 AM
issue with shell script chupacabra Linux - General 3 10-18-2002 08:12 PM
Out of guesses! (shell Script issue) chris Linux - General 2 12-10-2001 04:20 PM
Need help: Issue when exporting the display alexesp Linux - General 0 09-17-2001 04:48 AM > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 07:01 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration