delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2016/08/23/13:40:27

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=xHLr64DUSRptS6IR
qCPOPw0UacdXU76fOj2hodshnm8L1tReEjD6Fo554UukZ2ZvbDT2ErKeUsUKTW7p
9JIglqMgguWN2u6TiK0sQbny0R9T7Fj9wVJ/hm7I0tSuj9yoXlPA6neB7vwGBN18
ZU6mLwLKvxeiufTIh4WPopYslTA=
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=DN6Zoef67q5ZTFtyD5mO4g
DSB3c=; b=Pyv1IfAy3y4WBwXU+tMwWnYrXIR0rokGKsyQtzmoW57O1keebK6yZB
y+Jt6Idb6XrUkOLFY12zJ3rqdyUncCiWWRO+6xCK84VN+NacaPKqkmuz/LrxgAzU
xaFeZ1Z4MGOiddmU0GOebYFkFuXBwsboC7gpjyjxYBIyS+AK+Hf+M=
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.5 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 spammy=H*f:sk:Z86Fa5b, H*i:HTcYp8kgX4FFn, H*f:wQC, H*f:HTcYp8kgX4FFn
X-HELO: mail-it0-f45.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=HcsA9mdM4mwff3ZtZs6Pu5Kp3Ixx0vZOvDg6FpB6Aws=; b=T/Srfl2OuE9MvxNTldMV/u2pNq5pBHEZgvjL8VvFVJd1O1XVK85AydzkWe+1aIHWZs UvFlTwWklgslCozLjQTu6znbSazvum9pciY1dIIDuCXIHHQknfrLpdV91Ct56CxOnpRt YSsEZvtrGIw0AFW7ee3Xfge9EUfsEn8xGa0MUCGSjtyD36OUFP281mVuT6w27HrPeKnH GXx1b2dYdq1gb4UkS/lHHnx3UjlBG2Zzrpbwh1nZMa2RWLBdkUQC5JX11H8xzxgXuKHu pI6jGFX6Ge+AbP3sW+5HccVbRQqRciNCivTZHgb89bSOlgTOXHLXd8Z0nG9w9YheoTSt X7bw==
X-Gm-Message-State: AEkoouuJDlNs5PoY5DapFOaHXp8IZvf9YyNd88/rGk8TytZKjTOc03Ms/zOO7N4mH0TMsQ==
X-Received: by 10.36.25.144 with SMTP id b138mr28006808itb.29.1471973999585; Tue, 23 Aug 2016 10:39:59 -0700 (PDT)
Subject: Re: #!/bin/sh and #!/bin/bash is not the same
To: cygwin AT cygwin DOT com
References: <CA+7cx1oHkwK8vOV+2heYAhw=DhkrRfEvkbaj2pmH+x29ZP0T7Q AT mail DOT gmail DOT com> <fd1a102b-9df8-24b7-8440-9842b614fc6c AT gmail DOT com> <CA+7cx1p8ntAQriaYPJyBLcEu7sHPixs3sYUydx8XMZqQ20mL1g AT mail DOT gmail DOT com> <b12f15c3-121b-fea6-7dcf-a6c703434030 AT gmail DOT com> <CA+7cx1p88=wQC=HTcYp8kgX4FFn=Z86Fa5bZDceh0u4TPYx5gg AT mail DOT gmail DOT com>
From: cyg Simple <cygsimple AT gmail DOT com>
Message-ID: <fdfeefd7-50fb-d6b6-4e68-a20a221118df@gmail.com>
Date: Tue, 23 Aug 2016 13:40:14 -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: <CA+7cx1p88=wQC=HTcYp8kgX4FFn=Z86Fa5bZDceh0u4TPYx5gg@mail.gmail.com>
X-IsSubscribed: yes

On 8/22/2016 3:31 PM, Morten Kjærulff wrote:
> 
> 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)'
> 

See
http://stackoverflow.com/questions/12120598/syntax-error-in-shell-script-with-process-substitution
for the answer to your quandary.

-- 
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

- Raw text -


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