delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2004/03/17/12:12:57

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/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
X-Authentication-Warning: slinky.cs.nyu.edu: pechtcha owned process doing -bs
Date: Wed, 17 Mar 2004 12:12:17 -0500 (EST)
From: Igor Pechtchanski <pechtcha AT cs DOT nyu DOT edu>
Reply-To: cygwin AT cygwin DOT com
To: zzapper <david AT tvis DOT co DOT uk>
cc: cygwin AT cygwin DOT com
Subject: Re: Question on Perl (.pl) association
In-Reply-To: <j80h509t9tmal5m1iir11n8n3106jvb159@4ax.com>
Message-ID: <Pine.GSO.4.56.0403171204530.25803@slinky.cs.nyu.edu>
References: <d47g505k7514fdbq6kkf2rdkomou14q38n AT 4ax DOT com> <j80h509t9tmal5m1iir11n8n3106jvb159 AT 4ax DOT com>
MIME-Version: 1.0
X-Scanned-By: MIMEDefang 2.39

On Wed, 17 Mar 2004, zzapper wrote:

> Hi,
> Currently I'm getting round this by writing a simple wrap for my perl
> scripts. I use ActiveState Perl for historical reasons.
>
> eg
>
> #!/bin/bash
> # tipftp
> # description :Wrap for tipftp.pl
> c:/usr/local/bin/perl c:/cygwin/usr/local/bin/tipftp.pl
>
> zzapper (vim, cygwin, wiki & zsh)

I believe I posted this before, but here it goes again.  If all you want
to do is make 'shebang' ('#!') work with ActiveState (or other Windows
programs), put the following in your /usr/local/bin:

--------------------- BEGIN /usr/local/bin/wrap ---------------------
#!/bin/sh
pname="$1"
fname="`cygpath -wi "$2"`"
shift 2 && exec "$pname" "$fname" "$@"
------- Warning: cutting here may damage your screen surface --------

and then use it in the '#!' line of your script, e.g.,

------------------------ BEGIN activeperl.pl ------------------------
#!/usr/local/bin/wrap /cygdrive/c/ActivePerl/bin/perl
use English;
print "Testing: $PERL_VERSION on $OSNAME\n";
------- Warning: cutting here may damage your screen surface --------

or, in your case, '#!/usr/local/bin/wrap /cygdrive/c/usr/local/bin/perl'.
Note that this won't suddenly make your perl program understand POSIX
paths, i.e., if you want to pass a filename to that script, you'd have to
convert it yourself with `cygpath -w`...  Also beware the possible shebang
length limit...
HTH,
	Igor
-- 
				http://cs.nyu.edu/~pechtcha/
      |\      _,,,---,,_		pechtcha AT cs DOT nyu DOT edu
ZZZzz /,`.-'`'    -.  ;-;;,_		igor AT watson DOT ibm DOT com
     |,4-  ) )-,_. ,\ (  `'-'		Igor Pechtchanski, Ph.D.
    '---''(_/--'  `-'\_) fL	a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!

"I have since come to realize that being between your mentor and his route
to the bathroom is a major career booster."  -- Patrick Naughton

--
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