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:subject:to:references:from:message-id:date :mime-version:in-reply-to:content-type :content-transfer-encoding; q=dns; s=default; b=i4y3rPIDHSxcWbOH GacgvmGf2iLlyxup6sFPbQdGhb5B43dpIuQhmSFhH16du5U4r/0TX/ldUByaoZBV zxzxuJlNyPg26GQkqCQom1UEc6GoK7pW9P2XDVCbxkbkqpQQEqiyvhS891JoXeGq EOQTfM8dLykuSNb+zrFmHrLWE74= 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:subject:to:references:from:message-id:date :mime-version:in-reply-to:content-type :content-transfer-encoding; s=default; bh=UmOIJTxQrhlLvMPyTELHzm f7SDQ=; b=TTHQ3+s/gcEnx0QTjwHQB3kj4quLL/Mr5wd0oOzYsHlh4hB6JHNV6z Lp8zPbEyPMprOY0ha34q15c4dtbNqf8AhoKEPxoK4zUMweOJzsTt0R4k8Ga/sC3+ dJVIeV82iSAemk7r9ohO5aAw+Dg/nT6txH16XJTC0AJBqkKE3d60g= 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.5 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 spammy=TOP, emulation, POST, H*i:sk:7cx1p8n X-HELO: mail-it0-f41.google.com X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=ZwVrjoZaG2Tj/6qc6NNH+MndzhM+lVjKzQoAGMIchQA=; b=QSIMFbxvdkv302wLf4P35pduZUzmGthbpqs29hoBRV0x+XwDhhL2SodU9fuLR8i/Sz QSXrmyUMZbvE6Hmxt41GWwqX9M+m2J7/ts213b7euyyz6SeuPX90XXcRXptRDc/PIKf/ kDUkv2odGxnA3tiQ20icLVIrb2b05ynyb6La8dQPaiuCFjABoCLmiuxIOYUil4HYxpMF 265KLegJM4Y1JHx8REId8RTTogL5oS8G6KiS0qqRsbCyQ9qAuBhGtqfUP03iyRt4T+61 OZpMz/qFe5QSkNhMFOksjUTgqVNlQxVuVa93qcbjMoBqoL8hRz07HyBqQH5J0gjUPMZD mYEA== X-Gm-Message-State: AEkoousw2CQg9uO2hYpqd1nJ6fhLxOwVE4RKTcxbFh2iaoFkim83kiP4EaJgQWtty1GISQ== X-Received: by 10.36.213.131 with SMTP id a125mr21876255itg.14.1471891858530; Mon, 22 Aug 2016 11:50:58 -0700 (PDT) Subject: Re: #!/bin/sh and #!/bin/bash is not the same To: cygwin AT cygwin DOT com References: From: cyg Simple Message-ID: Date: Mon, 22 Aug 2016 14:51:09 -0400 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-IsSubscribed: yes Please do not TOP POST. On 8/22/2016 10:36 AM, Morten Kjærulff wrote: > 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 > What does ``/bin/sh --version'' print? The wait command is a shell internal command, there is no external equivalent. If you /bin/sh is bash then perhaps you've found a bug in the emulation of /bin/sh in bash. Bash takes a different code path when named sh. -- 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