X-Spam-Check-By: sourceware.org
Date: Wed, 10 Jan 2007 09:25:46 -0500 (EST)
From: Igor Peshansky <pechtcha@cs.nyu.edu>
Reply-To: cygwin@cygwin.com
To: Andrew DeFaria <Andrew@DeFaria.com>
cc: cygwin@cygwin.com
Subject: Re: activestate perl on cygwin
In-Reply-To: <eo2rgv$mm7$1@sea.gmane.org>
Message-ID: <Pine.GSO.4.63.0701100908530.6616@access1.cims.nyu.edu>
References: <1168360081.45a3c291af993@easymail-old.hol.gr> <45A3C4D6.F4A71EC7@dessent.net>  <31b7d2790701090912t71c9c3f6v38f4a1141619ad24@mail.gmail.com>  <003001c73461$788a7380$699f5a80$@rr.com> <eo2rgv$mm7$1@sea.gmane.org>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
Precedence: bulk
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie.com@cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com

On Wed, 10 Jan 2007, Andrew DeFaria wrote:

> I'm not sure I agree with your script's premise which states in the
> comment "Cygwin passes 'cygwin style' paths to the program in the #!
> statement". I don't believe that is true. Cygwin passes what you specify
> at the command line.

That part is actually correct.  Save the following two files, add the
directory where you saved test_script.wr to $PATH, and then invoke it by
name to see what I mean.
----------- BEGIN /usr/local/bin/wraptest -----------
#!/bin/sh
echo "$@"
------------ END /usr/local/bin/wraptest ------------
--------------- BEGIN test_script.wr ----------------
#!/usr/local/bin/wraptest
Doesn't matter what you put here...
---------------- END test_script.wr -----------------

FWIW, for the past few years I've been using the following script to allow
Windows programs in the shebang (#!) line:
------------- BEGIN /usr/local/bin/wrap -------------
#!/bin/sh
pname="$1"
fname="`cygpath -wi "$2"`"
shift 2 && exec "$pname" "$fname" "$@"
-------------- END /usr/local/bin/wrap --------------

A typical use would be as follows:

#!/usr/local/bin/wrap /cygdrive/c/perl/perl

which invokes ActiveState Perl with Win32 path to the current script and
with the rest of the arguments intact.
	Igor
-- 
				http://cs.nyu.edu/~pechtcha/
      |\      _,,,---,,_	    pechtcha@cs.nyu.edu | igor@watson.ibm.com
ZZZzz /,`.-'`'    -.  ;-;;,_		Igor Peshansky, Ph.D. (name changed!)
     |,4-  ) )-,_. ,\ (  `'-'		old name: Igor Pechtchanski
    '---''(_/--'  `-'\_) fL	a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!

Freedom is just another word for "nothing left to lose"...  -- Janis Joplin

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

