LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
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.

Notices


Reply
  Search this Thread
Old 11-01-2006, 04:15 PM   #1
trek413
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:

Code:
export TEST2=15


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

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


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

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

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