Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com
Date: Fri, 12 Mar 2004 15:05:40 -0500
From: Christopher Faylor <cgf-no-personal-reply-please@cygwin.com>
To: cygwin@cygwin.com
Subject: Re: Subshell
Message-ID: <20040312200540.GA4385@redhat.com>
Mail-Followup-To: cygwin@cygwin.com
References: <Pine.CYG.4.58.0403121346010.1332@lap>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <Pine.CYG.4.58.0403121346010.1332@lap>
User-Agent: Mutt/1.4.1i
Reply-To: cygwin@cygwin.com
Note-from-DJ: This may be spam

On Fri, Mar 12, 2004 at 01:49:27PM -0600, Gregory Borota wrote:
>#/bin/bash
>echo Silly
>( sleep 50 &
> ( sleep 50 ) )
>wait
>
>each subshell is "sh.exe".

Why would bash arbitrarily choose "sh.exe" as the subshell?

>I want to be be "bash.exe".  How do I force that without having to
>write bash -c ....
>
>P.S. Looked at cygwin faq, archive, didn't find the answer although this
>I would think has been brought up before.

Hmm.

  c:\>cd cygwin\bin

  c:\cygwin\bin>ren sh.exe sh-saf.exe
  C:\cygwin\bin\sh.exe -> C:\cygwin\bin\sh-saf.exe
       1 file renamed

  c:\cygwin\bin>bash
  bash-2.05b$ (sleep 1&)	# works
  bash-2.05b$ cat /tmp/tst
  #!/bin/bash
  echo Silly
  (sleep 1 &
   (sleep 1))
  bash-2.05b$ /tmp/tst
  Silly
  bash-2.05b$ # works

If bash used /bin/sh then it would have complained when running the above.

I verified via strace that bash wasn't looking for sh.exe and settling
for bash.exe if it didn't exist, too.
--
Please use the resources at cygwin.com rather than sending personal email.
Special for spam email harvesters: send email to aaaspam@sourceware.org
and be permanently blocked from mailing lists at sources.redhat.com

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

