bmatzelle / gow

Unix command line utilities installer for Windows.
https://github.com/bmatzelle/gow/wiki
6.58k stars 365 forks source link

can I use gow tools from Windows command line or BAT files? #194

Open aplatypus opened 9 years ago

aplatypus commented 9 years ago

Hi - This is a question that isn't covered in the FAQ.

If the programs are not intended to be launched by Windows then I'll need to look elsewhere. I tried GoW tools with a simple Batch .CMD script and it shows the same behaviour as the MSYS exe-s vis a vie access to the command-line *args ...

An example or as background can be seen on Stackoverflow, here:

I'm looking for Unix/Linux tools that I can fun from Windows/DOS shell and batch files. Many thanks for your time.

Regards,

Will

bytehead- commented 9 years ago

I'm not exactly sure what your question is here.

Do the GOW tools run in the Windows command shell (cmd.exe)? Yes, they do. Some require it, since we use some batch files to alias some commands to the programs that we are actually using.

If they are used in a batch file, then they are processed using cmd.exe, regardless if it is a .bat or .cmd file. When we had a mixed 16/32 bit environment, .bat was handled by command.com, and .cmd was handled by cmd.exe. Now that 16-bit has gone away (especially for those of us running 64-bit), cmd.exe handles both.

As to the stackoverflow question, cmd.exe and handling of special characters in a .bat/.cmd file is extremely problematic, especially when using shell variables. Between trying to determine when something needs to be double quoted or not, and the fact that some special characters may need further handling, it's a CF. Powershell would be much more suited to handling that situation. And GOW works under Powershell as well.

jaredstoker commented 9 years ago

I have been able to use curl in a batch file with several different pipes affecting the output.