Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , 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 Reply-To: cygwin AT cygwin DOT com To: zzapper cc: cygwin AT cygwin DOT com Subject: Re: Question on Perl (.pl) association In-Reply-To: Message-ID: References: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII 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/