From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9258 invoked by alias); 9 Nov 2011 15:30:38 -0000 Received: (qmail 9118 invoked by uid 22791); 9 Nov 2011 15:30:05 -0000 X-Spam-Check-By: sourceware.org Received: from aquarius.hirmke.de (HELO calimero.vinschen.de) (217.91.18.234) by sourceware.org (qpsmtpd/0.83/v0.83-20-g38e4449) with ESMTP; Wed, 09 Nov 2011 15:29:47 +0000 Received: by calimero.vinschen.de (Postfix, from userid 500) id 341872C0486; Wed, 9 Nov 2011 16:29:44 +0100 (CET) Date: Wed, 09 Nov 2011 15:30:00 -0000 From: Corinna Vinschen To: cygwin@cygwin.com Subject: Re: Pass windows-style paths to the interpreter from the shebang line ? Message-ID: <20111109152944.GK15154@calimero.vinschen.de> Reply-To: cygwin@cygwin.com Mail-Followup-To: cygwin@cygwin.com References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) 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-11/txt/msg00141.txt.bz2 On Nov 9 15:39, Timothy Madden wrote: > Hello > > I would like to write a php script to run from my cygwin command line. > I have the php CLI executable (php.exe) in PATH and I use > #!/bin/env php > as the first line of the .php script, and make it executable. > > The problem is that bash will than invoke the Win32 native php.exe > binary with the Cygwin-style path of my script as the argument, > and then php complains that it: > > `Could not open input file: /home/Adrian/usr/local/bin/parseLog.php´ > > Which is normal for php.exe, as it does not understand cygwin paths. > > I found no way around this problem. I would type `php /scriptname/´ > myself but then the script name would no longer be searched on PATH > and I would have to type > 'D:\Local\cygwin\home\Adrian\usr\local\bin\parseLog.php' as the > script name at all times. > > Is there a way around this ? Can cygwin detect the executable is not > a cygwin application add pass in the right path name ? That's not as easy as it may sound. What about creating wrapper scripts with the same name in another dir and put that dir in front of the other bin dir in $PATH? The wrapper scripts could be shell scripts which use `cygpath -wa' to convert the path to DOS notation and then call php. I'm surprised that we don't have php in the Cygwin distro. Did nobody try to port php to Cygwin yet? Corinna -- Corinna Vinschen Please, send mails regarding Cygwin to Cygwin Project Co-Leader cygwin AT cygwin DOT com Red Hat -- 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