From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fee84,8c983e5ff4afaf98 X-Google-Attributes: gidfee84,public X-Google-ArrivalTime: 1995-03-20 15:12:30 PST Newsgroups: comp.unix.osf.osf1 Path: nntp.gmd.de!dearn!blekul11!ccsdec1.ufsia.ac.be!reks.uia.ac.be!idefix.CS.kuleuven.ac.be! Belgium.EU.net!EU.net!howland.reston.ans.net!swrinde!gatech!newsfeed.pitt.edu!uunet!world!gnewman From: gnewman@world.std.com (Gary Newman) Subject: Re: Passing Environment Variables Message-ID: Reply-To: Bill O'Keefe Organization: XMX Corporation, Bedford, MA X-Newsreader: TIN [version 1.2 PL2] References: <16MAR95.21162637@shrsys.hslc.org> Date: Mon, 20 Mar 1995 20:50:13 GMT Alan Simon (simon@shrsys.hslc.org) wrote: : I know that the export command passes variables from the shell down to : subshells. How do I pass a variable from a subshell back up to the original : shell? Strictly speaking, you can't do that in UNIX. However, you can have the subshell echo a value to standard output, and store the output in a variable in the parent shell using back-quotes. For example, in the parent shell: ... VALUE=`myscript arg1 arg2 ...` echo VALUE is $VALUE ... and in 'myscript': ... echo "Return value" exit 0 Or, just send different exit codes back to the parent, and test the $status variable (cshell) or $? variable (bourne shell). Hope this helps. -- ------------------------------------------------------------------- Bill O'Keefe |Internet: bokeefe@xmx.com XMX Corporation | 46 Manning Road |Telephone: (508)670-8444