LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
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 02-18-2003, 09:54 AM   #1
sggrubb
LQ Newbie
 
Registered: Feb 2003
Posts: 2

Rep: Reputation: 0
Exporting to a super shell


How do I export to a super thread.
If I export say test

export test="Somthing"

that only make $test equal "Something" in sub Shells

How do I ""export"" a variable so that it is available in the shell that called the file. ie

file1:

#! /bin/sh
echo $TEST
./file2
echo $TEST

file2:

#! /bin/sh
Some Command $TEST="SOMETHING"

So that running file1 produces this output
<NOTHING HERE TEST NOT SET YET>
"SOMETHING"


Thanks
 
Old 02-18-2003, 10:34 AM   #2
finidi
Member
 
Registered: Dec 2002
Location: World
Distribution: Fedora Core 4
Posts: 127

Rep: Reputation: 15
Variables can be exported down to child shells but no way to do this to PARENT shells.

Normally global variables are exported in the file /etc/profile or in a the file which is executed when any new shell starts, that way global variables propagates down automatically to new child shells.
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
nfs write == super slow; read == super fast - problem? BrianK Linux - Networking 4 08-23-2007 10:59 PM
Basic question about exporting shell variables balteo Linux - General 2 09-13-2005 11:48 AM
exporting one NFS folder to another NFS and exporting it.... stellarmarine1 Linux - Networking 3 09-20-2004 06:54 AM
exporting display mendiratta Linux - Software 0 07-20-2004 07:01 AM
exporting graphics muneebs123 Linux - Newbie 1 09-07-2003 04:17 AM

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

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