This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Re: Pass windows-style paths to the interpreter from the shebang line ?
- From: Andrey Repin <anrdaemon at freemail dot ru>
- To: Timothy Madden <terminatorul at gmail dot com>, cygwin at cygwin dot com
- Date: Thu, 10 Nov 2011 05:27:23 +0400
- Subject: Re: Pass windows-style paths to the interpreter from the shebang line ?
- References: <j9dvqh$u92$1@dough.gmane.org>
- Reply-to: Andrey Repin <cygwin at cygwin dot com>
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