On Tue, Aug 26, 2008 at 5:33 PM, Dave B <[EMAIL PROTECTED]> wrote: > Pierre Gaston wrote: > >>> > On Tue, Aug 26, 2008 at 5:41 AM, R. Bernstein <[EMAIL PROTECTED]> wrote: >>> > > Both zsh and ksh have a way to open a file or duplicate a file >>> > > descriptor and let the interpreter pick the descriptor saving the >>> > > newly-allocated file descriptor number in a variable. In particular: >>> > > >>> > > exec {fd}<&0 >>> Perhaps you are thinking of the variation without braces? >>> >> >> well, I was thinking of the normal redirection syntax: >> exec 3<&0 >> >> I doubt '{fd}<&0' is meaningfull anywhere.....in ksh {fd} tries to >> run the command {fd} like in bash >> in zsh it tries to run the command "fd" >> What are you talking about??? > > I think he refers to the fact that, with ksh, you can do for instance > > $ exec {fd}<&0 > $ echo $fd > 10 > $ exec {fd1}<&0 > $ echo $fd1 > 11 > > I didn't try on zsh, but with bash you get: > > $ exec {fd}<&0 > -bash: exec: {fd}: not found > > -- > D. > ah sorry I didn't know this syntax
on which ksh version does this work? exec {fd}<&0 /usr/pkg/bin/ksh93: exec: {fd}: not found $ exec {fd}<&0 pdksh: {fd}: not found $ exec {fd}<&0 zsh: command not found: {fd}