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: List-Subscribe: List-Archive: List-Post: List-Help: , 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: References: From: =?UTF-8?Q?Morten_Kj=C3=A6rulff?= Date: Mon, 22 Aug 2016 16:36:13 +0200 Message-ID: Subject: Re: #!/bin/sh and #!/bin/bash is not the same To: cygwin AT cygwin DOT com Content-Type: text/plain; charset=UTF-8 X-IsSubscribed: yes Content-Transfer-Encoding: 8bit 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 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