4 ms·
I disagree. Having gnu utils available from CMD is a God send. Sometimes a batch script is the right tool but you need the capabilities of something from gnu ut
by Moto7451 12y ago
I disagree. Having gnu utils available from CMD is a God send. Sometimes a batch script is the right tool but you need the capabilities of something from gnu utils. It's much simpler to just invoke the tool than to rewrite the script as a windows flavored bash script you run from Cygwin.
Additionally you'll find a lot of scripting language libraries just wrap gnu utils and invoke commands using a sub shell. Being able to run those scripts/libraries from batch files or other windows processes without dealing with Cygwin is awesome too.
- deng 12y agoIndeed. Cygwin is fantastic, but one must always remember: once you go there, you can never go back. If you mix native Windows binaries with ones from Cygwin, all kinds of weird things can happen. I mostly work with native Windows binaries from ezwinports nowadays, together with ConEmu, Eclipse and a native Emacs; I can use normal Windows paths and things Just Work. Granted, it's more cumbersome to set this up than just installing Cygwin, but people are working on that (see for instance: MSYS2 at http://msys2.github.io/ http://msys2.github.io/)
- quotemstr 12y ago> once you go there, you can never go back. If you mix native Windows binaries with ones from Cygwin, all kinds of weird things can happen. I used that setup all the time and it worked fine for me. Mixing win32 and Cygwin binaries is the point of Cygwin, as far as I'm concerned.
- deng 12y agoThen you are a lucky man. Ever tried to work with MsysGit in a Cygwin shell? For starters, there's the CR-LF vs LF problem, which can screw you big time. Then there's the problem that Cygwin handles Windows paths differently from MSYS (C:\foo becomes /cygdrive/c/foo on Cygwin, /c/foo on MSYS, but that's just the obvious difference, filename handling is actually much more subtle). And then there's the stuff which you won't notice until it bites you, like for instance '.cmd' and '.bat' not being treated as executables in Cygwin.
- quotemstr 12y ago> Then there's the problem that Cygwin handles Windows paths differently from MSYS I don't use MSYS, but my Cygwin installs are rooted at C:\. Win32 path functions actually accept forward slashes as well as backward slashes as path separators, so often, Win32 programs interpret paths like "/etc/passwd" just fine (with the drive resolving to C:\). LF-versus-CRLF is an annoyance, but I've always solved it by using wrapper scripts that invoke u2d and d2u to perform the proper translation. I think I previously my "injob" utility. Thanks to your comment, I got around to putting it on github: https://github.com/dcolascione/injob https://github.com/dcolascione/injob