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
Passing a variable from a child script back to the parent Andy82 Shell Programming and Scripting 3 05-26-2008 10:52 PM
Killing parent shells from subshells (KSH) rockysfr Shell Programming and Scripting 4 06-28-2007 08:53 PM
Environment Variable Parent PID scotbuff Shell Programming and Scripting 1 02-12-2007 01:25 PM
How to pass CSH variables up to the parent? ElCaito Shell Programming and Scripting 0 11-30-2006 02:30 AM
Validating variables in shells script DeepakXavier Shell Programming and Scripting 1 09-23-2005 11:32 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 08-04-2007
konndanley konndanley is offline
Registered User
  
 

Join Date: Aug 2007
Posts: 3
Passing environment variables to parent shells

Hi,

I am using bash and need to run a set of tcsh scripts that set environment variables. Is there a way to do this? Any help greatly appreciated.
  #2 (permalink)  
Old 08-04-2007
kamitsin's Avatar
kamitsin kamitsin is offline
Registered User
  
 

Join Date: Nov 2006
Location: /dev/null
Posts: 177
Can you explain your requirement in detail please ????
  #3 (permalink)  
Old 08-04-2007
konndanley konndanley is offline
Registered User
  
 

Join Date: Aug 2007
Posts: 3
Thanks for the response.

I use Bash, but others have written a lot of scripts in tcsh. These tcsh set a lot of different environment variables that are used to set paths, tool licenses, etc....

So, for example, if i'm in Bash, I want to run a script called 'test.csh' that contains the single line:

setenv PROJ_HOME /proj/myproj

How do I get $PROJ_HOME to be seen from Bash?
  #4 (permalink)  
Old 08-04-2007
konndanley konndanley is offline
Registered User
  
 

Join Date: Aug 2007
Posts: 3
Got it

If I am in Bash, I have a C-shell script I want to run that sets an environment variable that I want, I can do this:

The file 'cshwrap' contains the line:
exec /bin/csh -c "source $1; exec /bin/bash"

Then I can just do:
. cshwrap cshfilename
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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




All times are GMT -4. The time now is 09:32 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0