On Wed, Jun 28, 2006 at 12:28:58PM +0100, Alastair McKinstry wrote:
> Package: bash
> Version: 3.1-4
> Severity: normal
> 
> Try the following script:
> 
> #!/bin/bash
> while read r; do
>   echo "line"
>   echo $r
> done < <(grep root /etc/passwd)
> # End of script
> 
> This is a valid script and executes ok, but if run with 'sh -x /tmp/script', 
> I get:
> sh -x /tmp/script
> /tmp/script: line 5: syntax error near unexpected token `<'
> /tmp/script: line 5: `done < <(grep root /etc/passwd)'
I guess this is deliberate; bash -x /tmp/script will work:

       If bash is invoked with the name sh, it  tries  to  mimic  the
       startup behavior  of  historical  versions  of sh as closely as
       possible, while conforming to the POSIX standard as well.

       [...]

       When  invoked  as sh,  bash enters posix mode after the startup
       files are read.

                posix        change the behavior of bash where the
                default operation differs from the 1003.2 standard to
                match the standard


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to