From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 79897 invoked by alias); 22 Aug 2016 14:36:46 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Received: (qmail 79880 invoked by uid 89); 22 Aug 2016 14:36:46 -0000 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@gmail.com, cygsimplegmailcom X-HELO: mail-lf0-f48.google.com Received: from mail-lf0-f48.google.com (HELO mail-lf0-f48.google.com) (209.85.215.48) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 22 Aug 2016 14:36:35 +0000 Received: by mail-lf0-f48.google.com with SMTP id f93so79378048lfi.2 for ; Mon, 22 Aug 2016 07:36:35 -0700 (PDT) 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 Received: by 10.25.213.204 with HTTP; Mon, 22 Aug 2016 07:36:13 -0700 (PDT) In-Reply-To: References: From: =?UTF-8?Q?Morten_Kj=C3=A6rulff?= Date: Mon, 22 Aug 2016 16:04:00 -0000 Message-ID: Subject: Re: #!/bin/sh and #!/bin/bash is not the same To: cygwin@cygwin.com Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes X-SW-Source: 2016-08/txt/msg00399.txt.bz2 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 wrote: > On 8/20/2016 1:42 PM, Morten Kj=C3=A6rulff 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