Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT sources DOT redhat DOT com Delivered-To: mailing list cygwin AT sources DOT redhat DOT com X-Apparently-From: Message-ID: <3AC86900.BA28372C@yahoo.com> Date: Mon, 02 Apr 2001 06:56:48 -0500 From: Earnie Boyd Reply-To: Earnie Boyd X-Mailer: Mozilla 4.76 [en] (WinNT; U) X-Accept-Language: en MIME-Version: 1.0 To: Jan Vicherek CC: "Larry Hall (RFK Partners, Inc)" , Andrew Markebo , Earnie Boyd Subject: Re: Batch files References: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Jan Vicherek wrote: > > Hmm, executing "foo.bat" works even without performing the three steps > below, but executing "foo" (where "foo.bat" is in the path), doesn't work > even if "#!.exe" is present ! : > > administrator AT BM80258908 /c > $ echo $PATH > /c/temp:.:/bin:/usr/bin:/sbin:/usr/sbin:/bin:/usr/bin:/sbin:/usr/sbin:/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin:/usr/bin:/bin:/usr/bin:/cygdrive/c/WINNT/system32:/cygdrive/c/WINNT:/cygdrive/c/vim/vim57 > > administrator AT BM80258908 /c > $ foo.bat > > c:\>echo test works ! > test works ! > > administrator AT BM80258908 /c > $ foo > bash: foo: command not found > > I presume that in order to make the three steps of the effect that > executing just "foo" will work, there is a prerequisite, right ? > Earnie, what would this prerequisite be ? > The prerequisite is that you have to live by the Win32 rules. The only way for the #! suggestion to work is to name the file foo.bat and execute foo.bat. All of this quibble over not specifying all of the filename is just nonsense. Where in UNIX land do you get filename extension recognition? IMO, the executing foo.exe by the name foo is bogus too as well as the .exe that is put there but if I want to play with cmd.exe/command.com they have to be. I don't see that executing foo if the file is named foo.bat exists will easily work. It already confuses autoconfiguration with foo.exe stat'ing as foo. If we change the routines to find foo.bat as foo then when we have foo.exe, foo.bat and foo/ in the same directory what does stat() stat? My recommendation is to live with it. Needing to type foo.bat when you want to execute foo.bat is here to stay. If you want to be lazy use the tab-completion routines of the readline library. Earnie. _________________________________________________________ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com -- Want to unsubscribe from this list? Check out: http://cygwin.com/ml/#unsubscribe-simple