From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5724 invoked by alias); 10 Nov 2011 01:35:18 -0000 Received: (qmail 5410 invoked by uid 22791); 10 Nov 2011 01:35:16 -0000 X-SWARE-Spam-Status: No, hits=3.5 required=5.0 tests=AWL,BAYES_50,FREEMAIL_FROM,KAM_THEBAT X-Spam-Check-By: sourceware.org Received: from mr0.ht-systems.ru (HELO mr0.ht-systems.ru) (78.110.50.55) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 10 Nov 2011 01:35:02 +0000 Received: from [91.76.230.58] (helo=darkdragon.lan) by mr0.ht-systems.ru with esmtpa (Exim 4.62) (envelope-from ) id 1ROJXg-00007Y-73; Thu, 10 Nov 2011 05:35:00 +0400 Received: from [192.168.1.10] (HELO daemon2.darkdragon.lan) by daemon2 (Office Mail Server 0.8.12 build 08053101) with SMTP; Thu, 10 Nov 2011 01:27:23 -0000 Date: Thu, 10 Nov 2011 01:35:00 -0000 From: Andrey Repin Reply-To: Andrey Repin Message-ID: <454021696.20111110052723@mtu-net.ru> To: Timothy Madden , cygwin@cygwin.com Subject: Re: Pass windows-style paths to the interpreter from the shebang line ? In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit 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-11/txt/msg00162.txt.bz2 Greetings, Timothy Madden! > 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. Dearly use Windows native version of PHP And here's a simple command file to register your PHP as script interpreter for both simple execution and windows scripting host jobs. @echo off if "!%~dpnx1" == "!" (echo Usage: %~dp0 path_to_php-cli.exe && exit) if not exist "%~dpnx1" (echo Invalid path to PHP interpreter && exit) ftype PHPScript="%~dpnx1" -f "%%1" -- %%* assoc .php=PHPScript regsvr32 "%~dp1\php5activescript.dll" If you still insist on using shebang, just use "#! php" without any additions. That assuming you have PHP in your application search path. Which is not limited to $PATH, so to speak. -- WBR, Andrey Repin (anrdaemon@freemail.ru) 10.11.2011, <05:19> Sorry for my terrible english... -- 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