Re: Ordering bug when handling redirection with file descriptors

2021-02-01 Thread Oğuz
1 Şubat 2021 Pazartesi tarihinde Chet Ramey yazdı: > > I'm not changing it now, > after 30 years. > Not even in posix mode? -- Oğuz

Re: Ordering bug when handling redirection with file descriptors

2021-02-01 Thread Chet Ramey
On 2/1/21 10:37 AM, Oğuz wrote: 1 Şubat 2021 Pazartesi tarihinde Chet Ramey > yazdı: I'm not changing it now, after 30 years. Not even in posix mode? It's not a simple change, and I have no idea how much code depends on the existing behavior. -- ``The ly

Re: Ordering bug when handling redirection with file descriptors

2021-02-01 Thread Chet Ramey
On 2/1/21 12:32 AM, Oğuz wrote: .. but, I'm not sure about this case: $ set -o posix $ a=`uname >&4` env 4>&1 bash: 4: Bad file descriptor a= Bash always performs word expansions and variable assignments preceding commands before redirections, and always has. I'm not changi

Re: Ordering bug when handling redirection with file descriptors

2021-02-01 Thread Chet Ramey
On 1/31/21 3:40 PM, Érico Nogueira wrote: Hi! I have the below test case which works with dash, zsh, and has been reported to work at least up to bash 4.4.12. After 4.4.23 it definitely no longer works (I have also tested with 5.1.4). #!/bin/sh fn() { echo a >&3 } b=`fn 3>&1 1>&4 4>&-`

Re: Ordering bug when handling redirection with file descriptors

2021-01-31 Thread Oğuz
.. but, I'm not sure about this case: $ set -o posix $ a=`uname >&4` env 4>&1 bash: 4: Bad file descriptor a= -- Oğuz

Re: Ordering bug when handling redirection with file descriptors

2021-01-31 Thread Oğuz
31 Ocak 2021 Pazar tarihinde Érico Nogueira yazdı: > > #!/bin/sh > > fn() { > echo a >&3 > } > > b=`fn 3>&1 1>&4 4>&-` 4>&1 Not a bug, POSIX allows implementations to perform assignments before redirections in this case. To guarantee `4>&1' is in effect while `b=`fn 3>&1 1>&4 4>&-`' is b

Ordering bug when handling redirection with file descriptors

2021-01-31 Thread Érico Nogueira
Hi! I have the below test case which works with dash, zsh, and has been reported to work at least up to bash 4.4.12. After 4.4.23 it definitely no longer works (I have also tested with 5.1.4). #!/bin/sh fn() { echo a >&3 } b=`fn 3>&1 1>&4 4>&-` 4>&1 With dash, it will simply exit sil