This is the mail archive of the cygwin mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: activestate perl on cygwin

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 -----------
echo "$@"
------------ END /usr/local/bin/wraptest ------------
--------------- BEGIN test_script.wr ----------------
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 -------------
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.
      |\      _,,,---,,_ |
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:
Problem reports:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]