The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Variable file name script Vish_chem UNIX for Dummies Questions & Answers 2 05-21-2008 11:00 PM
Value of a variable from another script big123456 Shell Programming and Scripting 2 04-24-2008 08:58 AM
Pass script variable value to AWK BearCheese Shell Programming and Scripting 1 06-28-2007 02:02 AM
Check if variable is set in script frustrated1 Shell Programming and Scripting 3 08-18-2005 11:22 PM
Trying to use 'compound variable' in a script neemic Shell Programming and Scripting 3 01-16-2004 04:07 AM

Closed Thread
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 10-21-2003
Registered User
 

Join Date: Oct 2003
Posts: 33
getting variable from script

Hi there
I'm absolutly new in this and i'm very confused allready.
I need to run a script from .profile , wich has no problem and when i return to .profile (this script runs from the middle of the .profile), i need to get a variable set on the scipt file.
I have puted this line in the end of the script :

export LOGT

and this is the value i need to get when returning to .profile.

How can i do this?
Forum Sponsor
  #2  
Old 10-21-2003
Perderabo's Avatar
Unix Daemon
 

Join Date: Aug 2001
Location: Washington DC Area
Posts: 8,667
Your script is a seperate process launched by your .profile. When it exits, its environment goes away, including the exported variable. A child process cannot change the environment of its parent.

Try this...
instead of
script
do this
. script

A dot script runs in the same process.
Google The UNIX and Linux Forums
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 09:00 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0