This is the mail archive of the
mailing list for the Cygwin project.
Re: run batch w/o .bat?
At 03:09 PM 6/3/2002, David T-G wrote:
>Larry, et al --
>...and then Larry Hall (RFK Partners, Inc) said...
>% At 02:27 PM 6/3/2002, Barnhart, Kevin wrote:
>% >I'm a new user to Cygwin, and although I'm sure someone has asked this
>% >question before, I'll ask it again (since I sure can't seem to find it in
>% >the FAQ or the archives).
>% The email archives is the place to look and look hard for something like
>I did, too, but I didn't find anything that looked familiar -- and yet I
>could swear that I had just seen this go by before.
Well, like I said, I didn't do anything more than ask for messages with
"batch" in them. Earnie's response was the fourth one based on score.
I definitely wasn't looking with something particular in mind. I just
reviewed what was returned in the order it was returned.
>My recollection is that there's a parameter in the cygwin world where you
>can add .bat to the extensions list that the shell should automatically
>append to an unqualified name so that it knows to run .bat files just
>like .exe and .com files. I haven't found that setting, though. While
>it certainly may not exist, I can hardly believe that I dreamed it or
>that I so badly misremembered something else...
I can't clarify your memory for you either. I can say that I don't know
of such a facility. The closest I know of is an analogous one in DOS which
uses PATHEXT. That said, I've never had a problem with typing the full name
to the batch file (i.e. <name>.bat) at the bash (or ash for that matter)
prompt and getting the batch file to run properly. I haven't set anything in
particular to get this to happen. It's just always worked for me, so long as
Cygwin thought the batch file was executable (i.e. chmod +x <name>.bat).
But, of course, creating #!.exe and adding it as the first line to the batch
file is exactly what tells Cygwin that this file should be treated as an
executable. So #!.exe is just another option if you can't get what you
want/need from chmod (like on 9x/Me systems).
>Having done quite a search through the archives since the question was
>first posted, and having found nothing but your #!.exe idea, which was
>*definitely* news to me (and some of the followups intimated that it
>might be problematic), I wonder myself if there is a simple way to tell
>bash to handle .bat files directly rather than mucking about with a #!
I'm not sure what posts you're referring to when you suggest that #!.exe
is problematic. I went back and reviewed the thread there and saw no
outstanding concerns about #!.exe. Perhaps you could qualify that statement
Obviously, you're welcome to pursue any .bat file issue you have further but
I see nothing wrong with the observations and solutions posted so far. They
address the stated concern of being able to run a batch file from Cygwin
Larry Hall firstname.lastname@example.org
RFK Partners, Inc. http://www.rfk.com
838 Washington Street (508) 893-9779 - RFK Office
Holliston, MA 01746 (508) 893-9889 - FAX
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Bug reporting: http://cygwin.com/bugs.html