delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2008/06/27/08:18:07

X-Recipient: archive-cygwin AT delorie DOT com
X-Spam-Check-By: sourceware.org
Message-ID: <4864DAD9.5EFC8601@dessent.net>
Date: Fri, 27 Jun 2008 05:19:37 -0700
From: Brian Dessent <brian AT dessent DOT net>
X-Mailer: Mozilla 4.79 [en] (Windows NT 5.0; U)
MIME-Version: 1.0
To: cygwin AT cygwin DOT com
Subject: Re: sourcing a perl script on cygwin
References: <435f371f0806270051g7734f46ai9be6649011a05cbe AT mail DOT gmail DOT com> <435f371f0806270055p7555331dt18cd8c868c7e208 AT mail DOT gmail DOT com> <435f371f0806270057j2800bea2xbc430867110f62a8 AT mail DOT gmail DOT com> <4864D40F DOT E6FCF336 AT dessent DOT net> <435f371f0806270504h3c4d18d3m1ff03bb06010daad AT mail DOT gmail DOT com>
X-IsSubscribed: yes
Reply-To: cygwin AT cygwin DOT com
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

Florin Barbalau wrote:

> thanks for the explication. so I should understand that I can never
> run a perl script like this in order to set environment variables for
> the calling one ?
> 
> I am very surprised about this problem because this is in the
> installation of an Oracle patch.

I don't see how that could ever possibly hope to work.  In order to
execute perl, you have to create a perl process.  Any changes to the
environment that that perl process makes will be completely discarded
when it exits, i.e. it's impossible for a child to modify a parent's
environment.

Are you sure that the perl script wasn't intended to be the parent
process of the shell, i.e. it sets up a modified environment and then
drops you in a (sub)shell with those changes?  If that's the case then
simply execing the perl script should work.

Brian

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


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