Portable shell code between Cygwin and Linux

Sven Köhler sven.koehler@gmail.com
Mon Aug 8 09:11:00 GMT 2011


Am 08.08.2011 10:14, schrieb Andrey Repin:
> Greetings, Sven Köhler!
> 
>>> alias vpnup='exec sudo openvpn --config $HOME/config/client.vpn --writepid /tmp/openvpn.pid &'
>>>
>>> that's where his problem began, IMO.
> 
>> I don't know, why you pointed that out. It's of no use to feed a path
>> like $HOME/something to a pure win32 binary.
> 
> You DON'T "feed a path like $HOME/something" !
> The shell that run the script will expand variable before passing it to the
> program.

A win32 (non-cygwin) executable doesn't that /cygdrive/c refers to c:\.
It also doesn't know that /home/bla is actually the same as
c:\cygwin\home\bla. A win32 simply doesn't use cygwin, hence don't know
about the translation from cygwin's POSIX paths to win32 ones.

It turned out, that the OP was not using a cygwin version of openvpn.
So if $HOME is a POSIX (cygwin specific) path, it won't work.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 262 bytes
Desc: OpenPGP digital signature
URL: <http://cygwin.com/pipermail/cygwin/attachments/20110808/e3e3c08e/attachment.sig>


More information about the Cygwin mailing list