delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2007/01/10/09:26:14

X-Spam-Check-By: sourceware.org
Date: Wed, 10 Jan 2007 09:25:46 -0500 (EST)
From: Igor Peshansky <pechtcha AT cs DOT nyu DOT edu>
Reply-To: cygwin AT cygwin DOT com
To: Andrew DeFaria <Andrew AT DeFaria DOT com>
cc: cygwin AT cygwin DOT 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 DOT 45a3c291af993 AT easymail-old DOT hol DOT gr> <45A3C4D6 DOT F4A71EC7 AT dessent DOT net> <31b7d2790701090912t71c9c3f6v38f4a1141619ad24 AT mail DOT gmail DOT com> <003001c73461$788a7380$699f5a80$@rr.com> <eo2rgv$mm7$1 AT sea DOT gmane DOT org>
MIME-Version: 1.0
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT 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 AT cs DOT nyu DOT edu | igor AT watson DOT ibm DOT 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/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019