X-Spam-Check-By: sourceware.org
From: "Herb Martin" <HerbM@learnquick.com>
To: <cygwin@cygwin.com>
Subject: RE: Calling shell script from DOS
Date: Fri, 27 Jan 2006 17:12:13 -0600
MIME-Version: 1.0
Content-Type: text/plain; 	charset="us-ascii"
Content-Transfer-Encoding: 7bit
In-Reply-To: <Pine.GSO.4.63.0601271316520.27873@access1.cims.nyu.edu>
Message-ID: <EITRXSR-000GW0-4C@mail2.learnquick.com>
X-Sign-LQC: HerbM@learnquick.com/2006-01-27 17:12:18/<cygwin@cygwin.com>=vlgfqaoo
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
Precedence: bulk
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie.com@cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com

> > I have installed Cygwin. I want to invoke a shell
> > script from the DOS/Windows command prompt (instead of
> > opening Cygwin Window first and calling it from
> > there). How can I do this?
> 
> In addition to what others said, use "bash -c" instead of 
> "bash" to honor
> the shebang ("#!") line.  This would then work for tcsh, ksh, perl,
> python, [you name it] scripts, as well as symlinks.  In fact, 
> whenever you
> need to invoke a Cygwin program from the DOS prompt, and you 
> don't know if
> it's a script, a symlink, or an actual .exe, you can't go 
> wrong with "bash
> -c progname".

Excellent!!!  I had noticed that things like 
"ls", "dir", "d" didn't work (without that -c).

Now they do too!

Or course, they would just run anyway without the
bash but you are correct that one must otherwise
know "what type" of command it is.

> Adding --login (-l) is optional, but may be useful for 
> scripts that make
> assumptions about your environment.

cool.

--
Herb Martin

> 


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

