| delorie.com/archives/browse.cgi | search |
| X-Recipient: | archive-cygwin AT delorie DOT com |
| X-SWARE-Spam-Status: | No, hits=-1.3 required=5.0 tests=AWL,BAYES_00,RCVD_NUMERIC_HELO |
| X-Spam-Check-By: | sourceware.org |
| Message-ID: | <4A2E931C.7070700@smart.net> |
| Date: | Tue, 09 Jun 2009 12:51:40 -0400 |
| From: | "Daniel B." <dsb AT smart DOT net> |
| User-Agent: | Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.19) Gecko/20081204 SeaMonkey/1.1.14 |
| MIME-Version: | 1.0 |
| To: | cygwin AT cygwin DOT com |
| Subject: | Re: Why sh failed 'Process Substitution'? |
| References: | <af0faace0906082347h42f0a93btd302002dc7288ee4 AT mail DOT gmail DOT com> <4A2E290B DOT 6040809 AT gmail DOT com> |
| In-Reply-To: | <4A2E290B.6040809@gmail.com> |
| 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 |
Dave Korn wrote:
> Pan ruochen wrote:
>> Hi All,
>> Why sh failed to recognize Process Substitution, even if /bin/sh.exe
>> is a copy of /bin/bash.exe?
>> $cat test.sh
>> #!/bin/bash
>> A="A"
>> B="B"
>> diff <(echo $A) <(echo $B)
>> $sh test.sh
>> a.sh: line 4: syntax error near unexpected token `('
>> a.sh: line 4: `diff <(echo $A) <(echo $B)'
>
> See the section "6.11 Bash POSIX Mode" in the bash info page, item 22:
>
>> " 22. Process substitution is not available. "
Pan,
What Dave didn't point out is that it's because you're running your
script using "sh test.sh" instead of using "test.sh" (or ./test.sh or
whatever, depending your execution search path setting (PATH)) (or even
using "bash test.sh").
Daniel
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/
| webmaster | delorie software privacy |
| Copyright © 2019 by DJ Delorie | Updated Jul 2019 |