delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2016/08/22/10:37:04

X-Recipient: archive-cygwin AT delorie DOT com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:mime-version:in-reply-to:references:from:date
:message-id:subject:to:content-type:content-transfer-encoding;
q=dns; s=default; b=qnyQhDDgEUzq5Czl2rjKWOoOkajJZcZ5uZlDmxVgiSV
6+clX5KW4kKHlgrgHF1x1+5MQBKckqpXToEGP7+I9dqsawJa+MVpHsEeY7hG2rIE
wbtyYSffPBzhDqEIpqACpqNKDRi817tMIHuT2HU4kUYEWo8dFDM+56HtOGzme+/s
=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:mime-version:in-reply-to:references:from:date
:message-id:subject:to:content-type:content-transfer-encoding;
s=default; bh=rxw7muDW0fzxYxicfYzmh7joKaA=; b=IvEparaFlrMJlAI7u
Fxru+1H0893C1wlSe2O27geMq3sUGoNFFBkTmCTSUS0ywC9JnxmAbqtuvAsB/9k0
o2iXzRHWVAnwumP7CB2/s6M7WGDkPzCSMiyFzFYczJz+Wh1s1gcydpmoJb5YgApj
1PUqf/fZYBtWpyhOcD+8mC/IIQ=
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/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
Authentication-Results: sourceware.org; auth=none
X-Virus-Found: No
X-Spam-SWARE-Status: No, score=-2.1 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 spammy=U*cygsimple, sk:cygsimp, cygsimple AT gmail DOT com, cygsimplegmailcom
X-HELO: mail-lf0-f48.google.com
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:content-transfer-encoding; bh=CSoxD5WVO01Ac1tvlc9MTNaSwSrv53/sBEwZOa/HUNI=; b=l4pFORU8bRSDhH73ZUGweLjbK97cWsNg3/LRwFn+PZDftG2YRoNo0Yau8imddW/I4y pxg78m962oC+QQiKODFrWQq/KUf9va7BwkiEepytNua4+Q4Bz8T80I3wyFjTIqic0Tn9 LPQa/C1gaP41F4KhW6LAhixbWmyBCcN3mSJ8syA/dAD14biJDYlOc9HBcIPOIp+Po2w7 ULXbfMs2H/FsOTcsLLdgzz7//r1qMKggWWXGw9S2DKtR0/qQJCosHcaxdrLAAxiPlmX7 CZD/dnNamAHZ8rg71AmvTI7Y4Vba9wW7u4No1W6/LpDqNRFeFwTeLlx9cC0XbwBv94Wi sgrQ==
X-Gm-Message-State: AEkooutmzu7ruKyN60xP9y+r1k2IbSh3QR9rtJXPeqd6KmLnZpfCTaQ4m+6nsKr4Ej14nsn0DxFR+YaRjKQX6g==
X-Received: by 10.25.169.213 with SMTP id s204mr6321887lfe.57.1471876593431; Mon, 22 Aug 2016 07:36:33 -0700 (PDT)
MIME-Version: 1.0
In-Reply-To: <fd1a102b-9df8-24b7-8440-9842b614fc6c@gmail.com>
References: <CA+7cx1oHkwK8vOV+2heYAhw=DhkrRfEvkbaj2pmH+x29ZP0T7Q AT mail DOT gmail DOT com> <fd1a102b-9df8-24b7-8440-9842b614fc6c AT gmail DOT com>
From: =?UTF-8?Q?Morten_Kj=C3=A6rulff?= <mortenkjarulff AT gmail DOT com>
Date: Mon, 22 Aug 2016 16:36:13 +0200
Message-ID: <CA+7cx1p8ntAQriaYPJyBLcEu7sHPixs3sYUydx8XMZqQ20mL1g@mail.gmail.com>
Subject: Re: #!/bin/sh and #!/bin/bash is not the same
To: cygwin AT cygwin DOT com
X-IsSubscribed: yes
X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id u7MEax55005846

Thanks.

What I was actually trying, was this:

echo a | while read ; do
  some_command &
done
wait

The "wait" did not wait. I guessed the reason was that "some_command
&" was executed in a subshell.

So I tried:

while read ; do
  some_command &
done < <(echo a)
wait

It was working, however not with #!/bin/sh

/Morten



On Mon, Aug 22, 2016 at 3:16 PM, cyg Simple <cygsimple AT gmail DOT com> wrote:
> On 8/20/2016 1:42 PM, Morten Kjærulff wrote:
>> Hi,
>>
>> I thought that #!/bin/sh in a script would be a bash, but it seems not
>> to be - or what am I doing wrong?
>>
>
> If you want to ensure that you have a particular flavor of shell then
> don't use /bin/sh.  The reason to use /bin/sh is that POSIX ensures it
> exists but it doesn't have to be bash, even on Linux.  For a generic
> shell script use ksh syntax, you'll find that it gets you further and is
> supported by bash.
>
> --
> cyg Simple
>
> --
> Problem reports:       http://cygwin.com/problems.html
> FAQ:                   http://cygwin.com/faq/
> Documentation:         http://cygwin.com/docs.html
> Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
>

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


- Raw text -


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