bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Equivalent of ksh, zsh {N}<[WORD] ?


From: Pierre Gaston
Subject: Re: Equivalent of ksh, zsh {N}<[WORD] ?
Date: Tue, 26 Aug 2008 17:37:58 +0300

On Tue, Aug 26, 2008 at 5:33 PM, Dave B <address@hidden> wrote:
> Pierre Gaston wrote:
>
>>>  > On Tue, Aug 26, 2008 at 5:41 AM, R. Bernstein <address@hidden> 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}




reply via email to

[Prev in Thread] Current Thread [Next in Thread]