This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Setting the Windows Path variable for children of a bash script....


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Incidentally, I have already thought of doing something like this:

# ...
Path="$(cygpath -pw "${PATH}");$(cygpath -pw "${LD_LIBRARY_PATH}")"
export Path
exec "${0}.bat" "${Path}" ${1+"${@}"}

Where "${0}.bat" may be something like:

set Path=%1
shift
%1 %2 %3 ...

But this does not work, since some of my arguments may contain spaces (which are not parsed correctly in the batch file), and batch files have an unusable limit on the number of useful arguments they can parse (%* is *not* affected by the shift batch file command, nor does it properly quote arguments). Using "%1" "%2" "%3" ... does not help either.

In short, I do not believe that batch files are a viable solution to my problem (though this may stem from my ignorance on how to write them robustly). Either way, I would like to find an alternate solution.

-- Matt


On Feb 8, 2005, at 14:43, Matthew Bogosian wrote:


...

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.

...

Does anyone know how to do this? Any help is much appreciated.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (Darwin)

iD8DBQFCCUMunLpDzL5I7l8RAv8PAKCRGQEebvZVYrlwziw2fNB9m/qfQACeP1me
VIpvbTm0cpnlYa+m3YDy+Zo=
=fRSK
-----END PGP SIGNATURE-----


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]