delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2001/03/30/18:39:41

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT sources DOT redhat DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT sources DOT redhat DOT com>
List-Help: <mailto:cygwin-help AT sources DOT redhat DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT sources DOT redhat DOT com
Delivered-To: mailing list cygwin AT sources DOT redhat DOT com
Message-ID: <E1B42CFD544FD31193EE0000E87C5CE799B49F@mailserver2.mqsoftware.com>
From: Glen Coakley <gcoakley AT mqsoftware DOT com>
To: "'cygwin AT cygwin DOT com'" <cygwin AT cygwin DOT com>
Subject: RE: Batch files
Date: Fri, 30 Mar 2001 15:44:25 -0600
MIME-Version: 1.0
X-Mailer: Internet Mail Service (5.5.2653.19)

cmd will grok it because it will look for a command called #!, which step
one instructs you to create. A note on step #2. You will want #!.exe in the
path that is set in Windows and in cgywin's bash but, it only has to be in
the path once. So, if you have added cygwin/bin to your normal windows path,
you shouldn't need to put it in windows/system32.

While we are on the topic of paths, you would really only need to add 
	#! cmd /c
as the first line of the batch file, since windows/system32 is always in the
windows path and cygwin builds it path on that.

I think I speak for many though, when I say that it would be nice to have
more intuitive support, such as it just working. I have many batch files
that I would rather not convert. Perhaps cygwin could recognize a first line
of "@echo off" as a DOS batch file and run the interpreter. Even better, and
I have wondered for a long time why I haven't seen this yet, programs could
be invoked on any file based on the results of that file's magic (see: man
file). 

________________________________
Glen Coakley, Sr. Software Engineer
MQSoftware Inc., (763) 543-4845
Have you ever wonder what happens when you run "rm -rf / " but been afraid
to try it?


> -----Original Message-----
> From: Andrew Markebo [mailto:flognat AT flognat DOT myip DOT org]
> Sent: Friday, March 30, 2001 2:09 PM
> To: Earnie Boyd
> Subject: Re: Batch files
> 
> 
> Will cmd still grokk the batch-file if you have a #! on the first
> line??
> 
>         /Andy
> 
> / Earnie Boyd <earnie_boyd AT yahoo DOT com> wrote:
> | "Larry Hall (RFK Partners, Inc)" wrote:
> | > 
> | > At 11:17 AM 3/30/2001, Matt Minnis wrote:
> | > 
> | > >Is there a way to get Cygwin to recognize that *.bat 
> files are executeable as:
> | > >fred.bat & fred (without the .bat)?
> | > 
> | > Anything's possible.  foo.bat works for me though.
> | > 
> | 
> | Hmm...  This isn't a FAQ yet?!
> | 
> | I've explained many times how to do this. 
> | 
> | 1) Create a noop program named #!.exe
> | 2) Install the it in C:/cygwin/bin and C:/windows/system32/
> | 3) Add `#! c:/windows/system32/cmd /c' to the .bat file as the first
> | line.
> | 
> | Earnie.
> | 
> | P.S.:
> | 
> | cat << EOD > noop.c
> | int main (void) {return 0;}
> | EOD
> | gcc -o \#\!.exe noop.c
> | 
> | _________________________________________________________
> | 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
> 
> --
> Want to unsubscribe from this list?
> Check out: http://cygwin.com/ml/#unsubscribe-simple
> 

--
Want to unsubscribe from this list?
Check out: http://cygwin.com/ml/#unsubscribe-simple

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019