From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27037 invoked by alias); 27 Jun 2008 14:37:03 -0000 Received: (qmail 27023 invoked by uid 22791); 27 Jun 2008 14:37:02 -0000 X-Spam-Check-By: sourceware.org Received: from wf-out-1314.google.com (HELO wf-out-1314.google.com) (209.85.200.174) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 27 Jun 2008 14:36:39 +0000 Received: by wf-out-1314.google.com with SMTP id 28so502769wfc.20 for ; Fri, 27 Jun 2008 07:36:37 -0700 (PDT) Received: by 10.142.223.20 with SMTP id v20mr548395wfg.81.1214577397405; Fri, 27 Jun 2008 07:36:37 -0700 (PDT) Received: by 10.143.187.7 with HTTP; Fri, 27 Jun 2008 07:36:37 -0700 (PDT) Message-ID: <435f371f0806270736t9ca6411k41aa87337b181a27@mail.gmail.com> Date: Fri, 27 Jun 2008 15:01:00 -0000 From: "Florin Barbalau" To: cygwin@cygwin.com Subject: Re: sourcing a perl script on cygwin In-Reply-To: <4864DAD9.5EFC8601@dessent.net> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <435f371f0806270051g7734f46ai9be6649011a05cbe@mail.gmail.com> <435f371f0806270055p7555331dt18cd8c868c7e208@mail.gmail.com> <435f371f0806270057j2800bea2xbc430867110f62a8@mail.gmail.com> <4864D40F.E6FCF336@dessent.net> <435f371f0806270504h3c4d18d3m1ff03bb06010daad@mail.gmail.com> <4864DAD9.5EFC8601@dessent.net> X-IsSubscribed: yes Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com X-SW-Source: 2008-06/txt/msg00600.txt.bz2 I understand that I can call a shell script from a perl script by using the command: exec("shell_script_name"); but when proceeding this way I don't have the environment variables that were set in the perl script. Is there anther way to call the shell script so that the shell child receives them? Thanks, Florin On 6/27/08, Brian Dessent wrote: > 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/ > > -- 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/