X-Recipient: archive-cygwin AT delorie DOT com X-Spam-Check-By: sourceware.org Message-ID: <435f371f0806270504h3c4d18d3m1ff03bb06010daad@mail.gmail.com> Date: Fri, 27 Jun 2008 14:04:15 +0200 From: "Florin Barbalau" To: cygwin AT cygwin DOT com Subject: Re: sourcing a perl script on cygwin In-Reply-To: <4864D40F.E6FCF336@dessent.net> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline 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> X-IsSubscribed: yes Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Hello Brian, 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. many thanks, Florin On 6/27/08, Brian Dessent wrote: > Florin Barbalau wrote: > > > then If i run: > > $ /cygdrive/d/cdb_10_2/content/bin/system/ifssetenv.pl > > it works ok. > > > > but if I try to source as in the calling script (install_cdaa.sh) I > > get error messages. : > > $ . /cygdrive/d/cdb_10_2/content/bin/system/ifssetenv.pl > > bash: use: command not found > > bash: use: command not found > > bash: /cygdrive/d/cdb_10_2/content/bin/system/ifssetenv.pl: line 31: > > syntax erro > > r near unexpected token `$^O' > > bash: /cygdrive/d/cdb_10_2/content/bin/system/ifssetenv.pl: line 31: > > `if (lc($^O > > ) eq "mswin32")' > > > > do you have any ideea why? > > > You have a misunderstanding of what sourcing means. When you tell the > shell to source a file it expects to read shell commands from that > file. It doesn't expect to find foreign commands in another language > like perl, and it doesn't honor the shebang since that is just a comment > in shell syntax. When you run a script, as opposed to sourcing it, the > OS (in this case Cygwin) reads the shebang line (#!/bin/perl) to know > what program to use to interpret the script, which is why that works. > > 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/