X-Recipient: archive-cygwin AT delorie DOT com X-SWARE-Spam-Status: No, hits=-2.4 required=5.0 tests=AWL,BAYES_00,SPF_PASS X-Spam-Check-By: sourceware.org Message-ID: <4A2ED44E.3080601@gmail.com> Date: Tue, 09 Jun 2009 22:29:50 +0100 From: Dave Korn User-Agent: Thunderbird 2.0.0.17 (Windows/20080914) MIME-Version: 1.0 To: cygwin AT cygwin DOT com Subject: Re: Why sh failed 'Process Substitution'? References: <4A2E290B DOT 6040809 AT gmail DOT com> <4A2E931C DOT 7070700 AT smart DOT net> In-Reply-To: <4A2E931C.7070700@smart.net> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit 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 Daniel B. wrote: > 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"). See the section "6.11 Bash POSIX Mode" in the bash info page, second para. from the top: >" When invoked as `sh', Bash enters POSIX mode after reading the > startup files. " cheers, DaveK -- 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/