Mail Archives: cygwin/2007/01/10/09:26:14
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 -