delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2005/02/08/18:08:03

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
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
Date: Tue, 8 Feb 2005 18:07:43 -0500 (EST)
From: Igor Pechtchanski <pechtcha AT cs DOT nyu DOT edu>
Reply-To: cygwin AT cygwin DOT com
To: Matthew Bogosian <mattb AT columbia DOT edu>
cc: cygwin AT cygwin DOT com
Subject: Re: Setting the Windows Path variable for children of a bash script....
In-Reply-To: <c97b679ac4abf5b562e0134cf11df760@columbia.edu>
Message-ID: <Pine.GSO.4.61.0502081805570.27816@slinky.cs.nyu.edu>
References: <c97b679ac4abf5b562e0134cf11df760 AT columbia DOT edu>
MIME-Version: 1.0

On Tue, 8 Feb 2005, Matthew Bogosian wrote:

> Howdy all,
>
> I've searched through the archives on this, but I've come up empty, so I
> figured I'd ask....
>
> I'm trying to execute a cygwin-ignorant Windows binary from a bash script.
> However, the DLLs required to load this binary are not in the system- or
> user-wide Windows Path variable (nor do I want them to be). I'm trying to
> modify the environment before execution of this binary, but it doesn't seem to
> work. Here's what I've got:
>
> # ...
> Path="$(cygpath -pw "${PATH}");$(cygpath -pw "${LD_LIBRARY_PATH}")"
> export Path
> exec /cygdrive/c/path/to/windows/binary.exe
>
> LD_LIBRARY_PATH contains the paths in which the DLLs specific to binary.exe
> reside. Unfortunately, binary.exe doesn't seem to be able to find them there
> when being invoked from the script's exec command.
>
> Before someone suggests the obvious, I am using Cygwin and bash (etc.) as a
> test harness for a binary I'm writing. I may test several different versions
> of the binary on the same machine. The DLLs cannot reside in c:\windows\...,
> nor can they reside in the same directory as binary.exe because binary.exe is
> actually c:\Python24\python.exe and the DLLs are from different versions of a
> third-party SDK that I'm accessing via swig/python. In short, I need to be
> able to override where the DLLs are found by the cygwin-ignorant version of
> Python in a shell script on an ad hoc basis.
>
> Please don't tell me to use Cygwin's python either, since I have to test the
> Windows version using the same test harness.
>
> Does anyone know how to do this? Any help is much appreciated.

PATH="${PATH}:${LD_LIBRARY_PATH}"
export PATH
exec /cygdrive/c/path/to/windows/binary.exe

The "PATH" variable is treated specially by Cygwin and is translated from
POSIX path format to Windows path format when calling Windows programs.
In your first case it was doing the translation twice, so C:\WINDOWS
became C;C:\WINDOWS.
	Igor
-- 
				http://cs.nyu.edu/~pechtcha/
      |\      _,,,---,,_		pechtcha AT cs DOT nyu DOT edu
ZZZzz /,`.-'`'    -.  ;-;;,_		igor AT watson DOT ibm DOT com
     |,4-  ) )-,_. ,\ (  `'-'		Igor Pechtchanski, Ph.D.
    '---''(_/--'  `-'\_) fL	a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!

"The Sun will pass between the Earth and the Moon tonight for a total
Lunar eclipse..." -- WCBS Radio Newsbrief, Oct 27 2004, 12:01 pm EDT

--
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