delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2000/08/22/12:23:12

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT sources DOT redhat DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT sources DOT redhat DOT com>
List-Help: <mailto:cygwin-help AT sources DOT redhat DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT sources DOT redhat DOT com
Delivered-To: mailing list cygwin AT sources DOT redhat DOT com
Message-ID: <39A2A7A0.7B9BFE5D@veritas.com>
Date: Tue, 22 Aug 2000 09:17:36 -0700
From: Bob McGowan <rmcgowan AT veritas DOT com>
Organization: VERITAS Software
X-Mailer: Mozilla 4.73 [en] (WinNT; U)
X-Accept-Language: en
MIME-Version: 1.0
To: Earnie Boyd <earnie_boyd AT yahoo DOT com>
CC: malcolmg AT gammacomputer DOT com, cygwin AT sourceware DOT cygnus DOT com
Subject: Re: help with exporting variables
References: <20000822123441 DOT 10654 DOT qmail AT web125 DOT yahoomail DOT com>

Earnie Boyd wrote:
> 
> --- Bob McGowan <rmcgowan AT veritas DOT com> wrote:
> > Malcolm Garland wrote:
> > >
> > > Hi,
> > > I'm Malcolm.  I've created a series of bourne shell scripts which set a
> > series of environment > variables.  Using bash, we are attempting to
> > export/use these scripts on NT.  When we run a > single line: "bash
> > 'script-name', the variables are set locally, but the NT "global" environment
> > > variables are not modified.  When execute the exact scripts, AFTER entering
> > the bash environment > (i.e., level with the bash prompt versus the DOS
> > prompt) the environment variables are set > globally.  How can we alter the
> > NT global environment variables using a single line command > directive such
> > as,
> > > $ bash "script-name" Options?
> >
> > Maybe?
> >
> >   bash -c "source script-name"
> >
> 
> NO!!  It is impossible to do what Malcolm wants the way he wants to do it.  It
> is the nature of the way parent/child processes work.  The child can inherit
> from the parent; but, the parent can't inherit from the child.
----

Malcolm stated that when he runs his script in an interactive shell, the
variables he is interested in are available.  I made the assumption,
perhaps unwarranted, that he knows what he is doing and that he was
sourcing the script.

I did make a mistake in my suggestion, which in fact does work, but
needs more, as in:

   bash -c "source script-name; other_actions"

where 'other_actions' would presumably make use of the information in
the "global" bash environment.

-- 
Bob McGowan
Staff Software Quality Engineer
VERITAS Software
rmcgowan AT veritas DOT com

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019