delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2003/08/05/16:29:44

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
X-Authentication-Warning: slinky.cs.nyu.edu: pechtcha owned process doing -bs
Date: Tue, 5 Aug 2003 16:29:01 -0400 (EDT)
From: Igor Pechtchanski <pechtcha AT cs DOT nyu DOT edu>
Reply-To: cygwin AT cygwin DOT com
To: David Selby <cygwin AT pusspaws DOT net>
cc: cygwin AT cygwin DOT com
Subject: Re: Yes but I don't understand ...
In-Reply-To: <3F30103F.3080700@pusspaws.net>
Message-ID: <Pine.GSO.4.44.0308051626120.1949-100000@slinky.cs.nyu.edu>
Importance: Normal
MIME-Version: 1.0

On Tue, 5 Aug 2003, David Selby wrote:

> Randall R Schulz wrote:
>
> > David,
> >
> > At 12:28 2003-08-05, David Selby wrote:
> >
> >> I have hit a problem with bash ... as a sample program I have ...
> >
> >
> > Your problem is that /bin/sh is ash, not BASH. To get BASH, use /bin/bash
> >
> >
> >> #!/bin/sh
> >>
> >> Dave
> >
>
> You are dead right, I tried
>
> /bin/bash <script>
>
> and it worked perfectly, but I am afraid I do not understand why ...
> echo $BASH_VERSION
> Tells me I have bash

Yes, because it's inherited from the parent shell environment, most
likely (or you're running the above command from bash).  You do have bash
installed, but as /bin/bash, *not* /bin/sh.

> I call cygwin with ...
> c:\cygwin\win\rxvt.exe -e \bin\bash --login -i
> ie bash

Yes, you explicitly invoke bash.

> Where did ash (a stripped down bash?) come in ?
> Dave

When you have the #!/bin/sh line at the top of the script, you're asking
the current shell (bash, tcsh, whatever) explicitly to execute the script
using /bin/sh (which, on Cygwin, is ash).  If you want to ensure the
script is executed by bash, use the #!/bin/bash magic at the top of the
script.  Assuming that /bin/sh = bash is non-portable.
	Igor
-- 
				http://cs.nyu.edu/~pechtcha/
      |\      _,,,---,,_		pechtcha AT cs DOT nyu DOT edu
ZZZzz /,`.-'`'    -.  ;-;;,_		igor AT watson DOT ibm DOT com
     |,4-  ) )-,_. ,\ (  `'-'		Igor Pechtchanski, Ph.D.
    '---''(_/--'  `-'\_) fL	a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!

"I have since come to realize that being between your mentor and his route
to the bathroom is a major career booster."  -- Patrick Naughton


--
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/

- Raw text -


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