Hacker News new | past | comments | ask | show | jobs | submit login

I recently tried starting Windows CLI programs from within bash and it worked just fine, but you have to specify the entire filename, like "./notepad.exe".



This is usually because, by default on many Linux flavours, the current directory is not included in your path environment variable.


This is generally the case in all Unix shells. See, for instance, https://superuser.com/questions/156582/why-is-not-in-the-pat....


Actually, given what Osiris appears to be getting at, it is because Unix shells in general have no notion of a PATHEXT system, and so do not go around tacking .COM, .CMD, .EXE, and the like onto the ends of command names.

The not searching the current directory is well known in the Unix and Linux world; and to be fair so too is the idea that if the filename of one's executable Perl script ends in .pl, or the filename of one's executable shell script ends in .sh, then the .pl and the .sh have to be explicit in the command name that one types. The idea that one can run notepad.exe with just notepad comes very much from the DOS and Windows world, here.

The Windows NT POSIX Subsystem actually provided a whole bunch of shims so that one could run various Win32 housekeeping utilities from a POSIX shell without explicitly adding ".exe", and a Korn shell adjustment to allow case-insensitive searches for Win32 commands.

* https://technet.microsoft.com/en-gb/library/bb463210.aspx


Just to note that this (to run scripts/executables you must specify the cwd in the cli invocation)is also the case for PowerShell. So, not unknown in the Windows world.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: