From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16291 invoked by alias); 29 Jul 2011 19:15:23 -0000 Received: (qmail 16275 invoked by uid 22791); 29 Jul 2011 19:15:21 -0000 X-SWARE-Spam-Status: No, hits=1.2 required=5.0 tests=BAYES_00,DATE_IN_PAST_03_06,FROM_LOCAL_NOVOWEL,HK_RANDOM_FROM,RCVD_NUMERIC_HELO,RP_MATCHES_RCVD,SPF_HELO_PASS X-Spam-Check-By: sourceware.org Received: from lo.gmane.org (HELO lo.gmane.org) (80.91.229.12) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 29 Jul 2011 19:15:07 +0000 Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1QmsWX-0001El-V1 for cygwin@cygwin.com; Fri, 29 Jul 2011 21:15:05 +0200 Received: from 83.101.44.240 ([83.101.44.240]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 29 Jul 2011 21:15:05 +0200 Received: from wxhgmqzgwmuf by 83.101.44.240 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 29 Jul 2011 21:15:05 +0200 To: cygwin@cygwin.com From: "Sebastien Vauban" Subject: Portable shell code between Cygwin and Linux Date: Fri, 29 Jul 2011 19:15:00 -0000 Message-ID: <80hb65b3ue.fsf@somewhere.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Url: Under construction... X-Archive: encrypt User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (windows-nt) X-IsSubscribed: yes Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com X-SW-Source: 2011-07/txt/msg00386.txt.bz2 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