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=HoVSiFuAJgZSt3seRcJGd8DeF2abX6O2Cej6RszvETS wBA9qwuLGV96gEuoBXBYAQqQuFEJLCj3G14cTw8J4F8Q2Ue7feun/7+viEm7jnk7 r2DT53AjhlaU8N+EBuUWcUV50CjeF48a0v5fG2NIu8nLatKgWkjY0fwA3B/8J8vg = 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=IsV6WY8e157Dl5zbYe43X6VgeVs=; b=WGrmcPcACEVj5LL+l UgU9zPX9CEGrTW3C+fC69oWTy6LrrpyP756wMRdYkkW1/mrixpWaybE5K6hb2gKn P+tgsKjFb0bGo+gDU4x7XUT9nbz6gnCy6TlvAwE7wTHJpuL4IyseKlbWE7nRm5Pp U5vBhpG0mw97OjZO8E1dXoVGqE= 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=cygsimplegmailcom, cygsimple AT gmail DOT com, H*f:sk:b12f15c, H*i:sk:b12f15c X-HELO: mail-lf0-f44.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=USb/3yrG4MP89YDgtLsf2E0eoj3FFAx6ak50J7F0v0U=; b=eSJIAFmhunfL3Q5c+XO+bersX8XSSZ7qHyxCj4Fl6ZhS1lyMORHqJPvwBiJreDZ0Oc EOAyO3jMAvkiIR+w/ozfelaZ0p3aX/2Ha2Dv2PsB4MRHX6xaBBOpfB7VmrzHemRpXNEl MwLcX9R/5OqctfqcbAKBtd+GPOoztk/es1o3gOsJiC528nh4BuWjkID1+ybW9/nb4mP2 iCCe7qeJpYJHWYH3xg0FM0NjyrzljLGWiU0F/c1CCy92m4tCUinSStbySGhs1bmnw+b/ Axd+afL9YLWGEjDoc1C4EKrwtWF73Hlx3rIV6QRrE86SKDBNH6TzHiuVaHaT9nVpAo1j WMqA== X-Gm-Message-State: AEkooutCJqI12jsF2nygp9JqiAh0z9kqEv5x32G71UmLMaVvQQm2zGMYcQeo1UJz0vjORrN/D8zcf2Tkh18QOw== X-Received: by 10.25.163.132 with SMTP id m126mr6622454lfe.56.1471894323093; Mon, 22 Aug 2016 12:32:03 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: References: From: =?UTF-8?Q?Morten_Kj=C3=A6rulff?= Date: Mon, 22 Aug 2016 21:31:42 +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 u7MJWQDQ017234 On Mon, Aug 22, 2016 at 8:51 PM, cyg Simple wrote: > 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 > Sorry, I think I have been confusing. This: date echo a | while read ; do sleep 3 & done wait date will run in 0 seconds, with BOTH /bin/sh and /bin/bash This: date while read ; do sleep 3 & done < <(echo a) wait date will run in 3 seconds with /bin/bash and get syntax errors with /bin/sh: syntax error near unexpected token `<' `done < <(echo a)' $ /bin/sh --version GNU bash, version 4.3.46(6)-release (x86_64-unknown-cygwin) Copyright (C) 2013 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later This is free software; you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. I believe all is ok. /Morten -- 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