*.COM, *.BAT must be explicitly specified to execute under bash?

Christopher Faylor cgf@redhat.com
Sun Nov 12 13:42:00 GMT 2000

On Sun, Nov 12, 2000 at 04:28:14PM -0500, Peter J. Farley III wrote:
>Hi all,
>This is my first time on this list, and I have read (I think) all of 
>the relevant parts of the faq and user guide that apply, but I still 
>don't understand why this happens.  First let me describe the problem; 
>my system and cygwin details are at the bottom.
>I have several directories in my W9x PATH in which I keep useful DOS 
>commandline utilities.  Some of these are *.COM executables, some need 
>*.BAT scripts to invoke a *.COM or *.EXE module.  In both cases, it 
>seems I must specify the whole file name on the bash command line 
>(e.g., DFX.COM or ED.BAT) in order to execute these programs or 

If you're asking about /bin/bash or /bin/sh, then, no, they don't recognize
.com or .bat extensions, and so, you're required to specify the extension
specifically.  The Cygwin DLL treats .exe specially such that when you
do an ls -l on a .exe file you don't need to specify the .exe, i.e.,

ls -l /bin/pwd


ls -l /bin/pwd.exe

are equivalent.  This means that bash can find a pwd in your path and execute

Cygwin doesn't provide this for such things as .bat and .com files, since IMO,
this would slow things down for little gain.

If someone wants to provide a patch to make this configurable, however, I might
consider it.


Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

More information about the Cygwin mailing list