public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* Portable shell code between Cygwin and Linux
@ 2011-07-29 19:15 Sebastien Vauban
  2011-07-29 19:45 ` Larry Hall (Cygwin)
                   ` (2 more replies)
  0 siblings, 3 replies; 32+ messages in thread
From: Sebastien Vauban @ 2011-07-29 19:15 UTC (permalink / raw)
  To: cygwin

Hello,

For every shell code that I write, I'd like it to be portable both to Cygwin
on Windows, and to Ubuntu Linux for example.

It's kinda possible, but am blocked with such a use case:

alias vpnup='exec sudo openvpn --config ~/config/client.vpn --writepid /tmp/openvpn.pid &'

While this worked perfectly under Ubuntu, I've had to make up a customized
version for Windows:

alias vpnupwin='cd c:/home/sva/config; openvpn --config client.vpn --writepid c:/cygwin/tmp/openvpn.pid &'

Here, I cd first to my config file, as I removed full paths from client.vpn
config file:

    ,----
    | ## client.vpn --- client-side OpenVPN config file
    | 
    | # SSL/TLS parms.
    | ca ca.crt
    | cert fni.crt
    | key fni.key
    `----

instead of:

    ,----
    | ## client.vpn --- client-side OpenVPN config file
    | 
    | # SSL/TLS parms.
    | ca /home/sva/config/ca.crt
    | cert /home/sva/config/fni.crt
    | key /home/sva/config/fni.key
    `----

I'm aware of cygpath, but still don't see clearly which are the best trade-off
to be able to write portable shell code -- if possible. Any hint?

Best regards,
  Seb

-- 
Sebastien Vauban


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 32+ messages in thread

end of thread, other threads:[~2011-08-10 12:03 UTC | newest]

Thread overview: 32+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-07-29 19:15 Portable shell code between Cygwin and Linux Sebastien Vauban
2011-07-29 19:45 ` Larry Hall (Cygwin)
2011-08-01  6:40   ` Sebastien Vauban
2011-07-29 19:47 ` Eliot Moss
2011-08-01  6:45   ` Sebastien Vauban
2011-07-29 20:17 ` Corinna Vinschen
2011-07-30 12:20   ` Andrey Repin
2011-08-01  6:50     ` Sebastien Vauban
2011-08-01  7:28       ` Csaba Raduly
2011-08-02 11:58         ` Sebastien Vauban
2011-08-02 12:36           ` Sebastien Vauban
2011-08-05 16:05       ` Andrey Repin
2011-08-08  1:16     ` Sven Köhler
2011-08-08  2:07       ` Eliot Moss
2011-08-08 22:17         ` Gary Johnson
2011-08-08  8:20       ` Andrey Repin
2011-08-08  9:11         ` Sven Köhler
2011-08-08 14:27           ` Eliot Moss
2011-08-01  7:00   ` Sebastien Vauban
2011-08-01  7:44     ` Corinna Vinschen
2011-08-02 12:11       ` Sebastien Vauban
2011-08-02 12:23       ` Sebastien Vauban
2011-08-02 14:37         ` Corinna Vinschen
2011-08-01  9:21     ` Thorsten Kampe
2011-08-02 12:25       ` Sebastien Vauban
2011-08-02 15:41         ` Eliot Moss
2011-08-02 20:05           ` Thorsten Kampe
2011-08-02 20:45             ` Christopher Faylor
2011-08-03 16:23             ` Andy Hall
2011-08-08  1:20         ` Sven Köhler
2011-08-08 13:41           ` Eric Blake
2011-08-10 12:03             ` Sven Köhler

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).