public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: cyg Simple <cygsimple@gmail.com>
To: cygwin@cygwin.com
Subject: Re: #!/bin/sh and #!/bin/bash is not the same
Date: Tue, 23 Aug 2016 22:19:00 -0000	[thread overview]
Message-ID: <fdfeefd7-50fb-d6b6-4e68-a20a221118df@gmail.com> (raw)
In-Reply-To: <CA+7cx1p88=wQC=HTcYp8kgX4FFn=Z86Fa5bZDceh0u4TPYx5gg@mail.gmail.com>

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

      reply	other threads:[~2016-08-23 17:40 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-20 21:32 Morten Kjærulff
2016-08-20 21:54 ` Hans-Bernhard Bröker
2016-08-22 13:54 ` cyg Simple
2016-08-22 16:04   ` Morten Kjærulff
2016-08-22 20:50     ` cyg Simple
2016-08-22 23:13       ` Morten Kjærulff
2016-08-23 22:19         ` cyg Simple [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=fdfeefd7-50fb-d6b6-4e68-a20a221118df@gmail.com \
    --to=cygsimple@gmail.com \
    --cc=cygwin@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).