![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How to change parent shell's variables? | pankai | Shell Programming and Scripting | 1 | 01-17-2008 04:32 PM |
| Passing environment variables to parent shells | konndanley | UNIX for Dummies Questions & Answers | 3 | 08-04-2007 06:15 PM |
| How to pass variables to FUNCTION ? | bh_hensem | Shell Programming and Scripting | 5 | 05-31-2007 03:54 AM |
| how to pass variables surrounded in double quotes to awk? | cruiser | AIX | 4 | 03-24-2006 05:12 PM |
| Pass multiple variables to SQL script | jagannatha | Shell Programming and Scripting | 1 | 10-25-2002 10:45 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
How to pass CSH variables up to the parent?
Hi ..
I have a dynamic script called from a programming language called Powerhouse (4GL). The module, called QUIZ, allows the user to call shell commands from within it... i.e. !rm -f mipss156t2cmd1.bat mipss156t2tmp1.txt !printf '#!/bin/csh\n' > mipss156t2cmd1.bat !printf 'setenv ACCOUNTS "' >> mipss156t2cmd1.bat !cat mipss156t2b.ps >> mipss156t2cmd1.bat !printf '"\n' >> mipss156t2cmd1.bat !chmod 770 mipss156t2cmd1.bat !printf 'export ACCOUNTS\n' >> mipss156t2cmd1.bat ;run the BAT file to create the environment variable !source ./mipss156t2cmd1.bat !rm -f mipss156t2cmd1.bat mipss156t2tmp1.txt What I am trying to do here is create a C shell (doesn't have to be C shell) script to create an environment variable called $ACCOUNTS. I then want this value to be available to the QUIZ module (the parent). The above, even with the !source line, does not work and when I manually echo the $ACCOUNTS variable, it's actually empty! It should not be empty as the mipss156t2b.ps file (a text file) has the value I want to place into ACCOUNTS variable. But, for some reason the variable is "lost" when the above script returns back to the parent (ie. QUIZ program). I read somewhere that it's not possible to create child variables and have them available to the parent shell. Is this true? Thank you in advance |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|