public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Andrey Repin <anrdaemon@freemail.ru>
To: Timothy Madden <terminatorul@gmail.com>, cygwin@cygwin.com
Subject: Re: Pass windows-style paths to the interpreter from the shebang line ?
Date: Thu, 10 Nov 2011 01:35:00 -0000	[thread overview]
Message-ID: <454021696.20111110052723@mtu-net.ru> (raw)
In-Reply-To: <j9dvqh$u92$1@dough.gmane.org>

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

  parent reply	other threads:[~2011-11-10  1:35 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-09 13:40 Timothy Madden
2011-11-09 15:30 ` Corinna Vinschen
2011-11-09 15:46   ` Jeremy Bopp
2011-11-09 15:51     ` Corinna Vinschen
2011-11-10  1:14       ` PHP (was: Re: Pass windows-style paths to the interpreter from the shebang line ?) Yaakov (Cygwin/X)
2011-11-10 10:05         ` Corinna Vinschen
2011-11-09 21:16     ` Pass windows-style paths to the interpreter from the shebang line ? Timothy Madden
2011-11-09 21:20       ` Christopher Faylor
2011-11-09 15:51   ` Jeremy Bopp
2011-11-10  1:35     ` Andrey Repin
2011-11-09 16:27   ` Andrew DeFaria
2011-11-09 15:51 ` Marco Atzeri
2011-11-10  1:35 ` Andrey Repin [this message]
2011-11-10  9:46   ` Linda Walsh
2011-11-10 10:43   ` Timothy Madden
2011-11-10 14:20     ` Andrey Repin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=454021696.20111110052723@mtu-net.ru \
    --to=anrdaemon@freemail.ru \
    --cc=cygwin@cygwin.com \
    --cc=terminatorul@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).