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: Fri, 26 Mar 2004 13:35:33 -0500 (EST) From: Igor Pechtchanski Reply-To: cygwin AT cygwin DOT com To: david mallon cc: cygwin AT cygwin DOT com Subject: RE: bash bad interpreter - a new twist! In-Reply-To: Message-ID: References: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Scanned-By: MIMEDefang 2.39 Dave, FWIW, the following always works on my system: #!/usr/local/bin/wrap /cygdrive/c/ActivePerl/bin/perl use English; print "Testing: $PERL_VERSION on $OSNAME\n"; where /usr/local/bin/wrap is #!/bin/sh pname="$1" fname="`cygpath -wi "$2"`" shift 2 && exec "$pname" "$fname" "$@" This will work for any Windows program that accepts a script as a parameter. This won't change any of the filename parameters other than the script itself, but I'm sure it could be adapted... If your script doesn't work in the #! line, check your script. Make sure it has all the binaries specified with an absolute path, i.e., it doesn't rely on the PATH variable. Igor On Fri, 26 Mar 2004, david mallon wrote: > Thanks Tom, I believe you are right. > I noticed yesterday that if the interpreter was a binary the problem went > away, so I rewrote my script as a C program and everything is stable again. > > -- dave > > >From: nicebouncetrodmancom (Tom Rodman) > > > > >I'm using cygwin (september 2003 build) and ActiveState perl. To connect > > >ActiveState into cygwin I use a proxy /usr/local/bin/perl bourne shell > > >script that essentially transalates the paths (cygpath -w) and delegates to > > >the ActiveState perl.exe binary. Given the following foobar script: > > > > > >#!/usr/local/bin/perl -w > > >print "foobar world\n"; > > > >The "#!" construct must always refer to a binary, > >never to another script (to avoid loops?). I ran into the same issue. > >The UNIX standard is what I just said, but earlier (and current?) > >cygwin versions (wrongly) sorta supported a script. In 1.3.20 it works > >about 2 out of 5 times or so - if you try a similar approach on > >a UNIX box it will fail *every* time. > > > >Years back there was a cygwin tool called dbash.exe to support > >what your trying to do. > > > >Try "man execve" on a UNIX box for more on the "#!" construct. > > > >You just need to rethink your workaround.. > > > >I'm sure others can correct some of what I just said, but I believe > >is mostly right ;-> -- 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/