public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* Executing .bat files from bash
@ 2000-03-07  8:56 Dan.Karipides
  2000-03-07 10:07 ` Bob McGowan
  0 siblings, 1 reply; 3+ messages in thread
From: Dan.Karipides @ 2000-03-07  8:56 UTC (permalink / raw)
  To: cygwin

I've searched the archives for this and can only find very old articles
that don't
directly answer my question.

I've noticed in the current b20.1 release, that I can run a bat file simply
by
typing it's name.  I haven't seen the need to type "cmd /c <file>.bat",
which
was suggested in the older archived mail.  All I need to type is <file>.bat
and the bat file will execute.  However, I'm wondering if I can set an
environment variable or a registry key or something that will eliminate
the need to type the ".bat" extension.  Basically, .exe files don't need
it,
.sh files don't need it -- anyway that .bat can be made to not need the
extension to execute?  I'll even patch bash if I have to.

(Background info.  Here at work, I have to use hundreds of batch files a
day, I don't haven any choice in that.  It's too cumbersome to have to
type the .bat each time.  It's so bad, in fact that I've been forced to use
the
NT command shell.  *shudder*).

Thanks in advance,

-Dan
-----
Integration Consultant
Trilogy Software




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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Executing .bat files from bash
  2000-03-07  8:56 Executing .bat files from bash Dan.Karipides
@ 2000-03-07 10:07 ` Bob McGowan
  0 siblings, 0 replies; 3+ messages in thread
From: Bob McGowan @ 2000-03-07 10:07 UTC (permalink / raw)
  To: Dan.Karipides; +Cc: cygwin

Dan.Karipides@trilogy.com wrote:
> 
> I've searched the archives for this and can only find very old articles
> that don't
> directly answer my question.
> 
> I've noticed in the current b20.1 release, that I can run a bat file simply
> by
> typing it's name.  I haven't seen the need to type "cmd /c <file>.bat",
> which
> was suggested in the older archived mail.  All I need to type is <file>.bat
> and the bat file will execute.  However, I'm wondering if I can set an
> environment variable or a registry key or something that will eliminate
> the need to type the ".bat" extension.  Basically, .exe files don't need
> it,
> .sh files don't need it -- anyway that .bat can be made to not need the
> extension to execute?  I'll even patch bash if I have to.

Dan,

I don't have a patch for bash but a suggestion that might help, assuming
that the batch files you use are "stable" (total number constant,
infrequent additions or deletions from the list) so maintenance would be
easier.

Create a series of aliases for your batch commands in the .bashrc file:

    alias file=file.bat
    alias file1=file1.bat
    etc...

-- 
Bob McGowan
Staff Software Quality Engineer
VERITAS Software
rmcgowan@veritas.com

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Executing .bat files from bash
@ 2000-03-08 11:38 kulack
  0 siblings, 0 replies; 3+ messages in thread
From: kulack @ 2000-03-08 11:38 UTC (permalink / raw)
  To: cygwin

On 03/07/2000 at 01:09:57 PM, Bob McGowan <rmcgowan@veritas.com> wrote:
I'll even patch bash if I have to.

The alias model works well, but if you have more dynamic batch files,
create a shell script of the name <file> for batch file <file>.bat.
The shell script does <file>.bat.
Done.

You can easily create a tool to automate this too. (left to the reader).
- For each component of the path variable.
- look for files named *.bat in that directory.
- Create a file of the same name without the extension in that directory.
- chmod to make it executable.




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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2000-03-08 11:38 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-03-07  8:56 Executing .bat files from bash Dan.Karipides
2000-03-07 10:07 ` Bob McGowan
2000-03-08 11:38 kulack

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).