On 2016-05-17, Manuel Collado <m.co...@domain.invalid> wrote:
> El 16/05/2016 15:45, Andrew Schorr escribió:
>> On Monday, May 16, 2016 at 9:03:55 AM UTC-4, Marc de Bourget wrote:
>> I have installed Cygwin on many PCs, and it never caused any problems.
> > Maybe you should try it again. It is easy to install and works very well.
>>
>>> On top of that, I prefer native Windows binaries.
>>
>> Why? In what way is a native Windows binary better than a Cygwin program?
> > I'm not suggesting that it isn't, but I'd like to be educated. Is it
> a performance issue?
>
> Cygwin allows me to profit from almost all the comprehensive GNU
> software. But there are some issues when trying to combine Cygwin
> programs with "native" Windows programs in the same toolchain.
>
> There are some subtle issues when calling a Cygwin program from a
> Windows CDM.EXE shell,
Few native Windows programs are used this way. Nothing that is targetted
at everyday use by end users.
There are issues when calling *any* command line program a shell on
Windows. The main one is that the command line is a single character
string, whose parsing is entirely up to the process which receives it.
The application decides how the string is delimited into arguments and
all the quoting rules.
Scripting with an programs whatsoever out of CMD.EXE is rife with
issues.
Even if you have a so-called "native" Awk compiled with MinGW or
whatever, you cannot use it with all but the most trivial "Unixy"
one-liners out of CMD.EXE.
The special Cygwin issue used to be (IIRC) that Cygwin programs (the standard ones)
didn't understand a path like "C:\users\Bob". This had to be
"/cygdrive/c/users/Bob" under Cygwin. That isn't true any more.
I just tried
ls c:\\users\\kaz
ls c:/users/kaz
ls /cygdrive/c/users/kaz
at a Cygwin bash prompt: all three work. Even if they didn't,
you could still write a Cygwin program (an executable linked to
cygwin.dll) such that it understands a Windows path.
> or when calling native Windows programs from a
> Cygwin bash shell.
The use of the bash shell has no bearing on whether a program linked
with cygwin.dll is "native" or not; such a thing can be deployed without
including Bash.
On the other hand, if you actually want to use utilities and languages
from the Unix environment in all the ways that they are meant to be
used, including convenient one-liners from the shell prompt with all the
quoting and escaping rules, you are much better off with Cygwin: using
the Cygwin shell to run Cygwin programs.
I use a Cygwin bash shell script as a Windows service, which I can start
and stop with the Services MSI control panel in Windows. The script runs
in a loop and maintains a tunnel (via Cygwin's build of ssh).
If you reboot the machine, it nicely starts up, even with nobody logged
in.
That's "native" enough for me, thank you very much.