[Top][All Lists]

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

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

From: Dave B
Subject: Re: Equivalent of ksh, zsh {N}<[WORD] ?
Date: Tue, 26 Aug 2008 16:33:10 +0200
User-agent: Thunderbird (X11/20080725)

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
$ exec {fd1}<&0
$ echo $fd1

I didn't try on zsh, but with bash you get:

$ exec {fd}<&0
-bash: exec: {fd}: not found


reply via email to

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