Cygwin script wrapper (native)

Andrey Repin
Mon Jan 5 02:20:00 GMT 2015

Greetings, All!

I think I've finally ironed out most of the issues I had with it. (Infinite
number of arguments, quoting, etc.)
The only known issues that cause script to break seems to be the same as you
would expect with direct script executions - uneven/misplaced quotation marks.

How to use:
Place the attached script as /bin/cygwrap.cmd (placement is important, as the
script working out certain paths relative to its location).
Run the script. Short notice should appear, mentioning usage and registration
Run the script with "--install" option. By default, the script only register
the ".sh" extension. You may list additional extensions after "--install",

  cygwrap.cmd --install .pl .py

Then try executing a simple[1] script with all kind of arguments and
see if there's any significant discrepancy in what you pass to the script and
what is actually interpreted from your input.
Keep in mind, that "="(equality sign) is a parameter separator in CMD, and
parameters containing it must be enclosed in double quotes.

If you want to execute Cygwin scripts from native CMD scripts through this
association, and/or use CMD completion/executable search functions, you will
need to adjust your %PATHEXT% variable to include relevant extensions.

If you are not happy with wrapper prepending Cygwin's bin directory to the
%PATH%, i.e. if you already have your path set up to include Cygwin/bin, feel
free to comment out the relevant line from the script.

#!/bin/sh -x
echo "$PATH"
echo $#: "$@"

Andrey Repin

Sorry for my terrible english...
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: cygwrap.txt
URL: <>
-------------- next part --------------
Problem reports:
Unsubscribe info:

More information about the Cygwin mailing list