Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: PATCH: allocating a new file descriptor



On Apr 12,  1:57pm, Peter Stephenson wrote:
}
} This gives us much better encapsulation for manipulating file
} descriptors, something along the lines of files or file handles in
} other languages.

I think some oddball behaviors here might be considered bugs.

For example,

    print foo {myfd}>/dev/null

assigns a new fd to $myfd, but does not redirect the output of "print"
to it, and leaves it open after "print" is finished.

Futher, executing the same command again assigns a second new fd to $myfd
but leaves the first one "dangling" (no way to close it, because you no
longer know what its number is).

I don't think Korn's summary implied either of these behaviors, but if
it does they should probably be brought to his attention.

} The shell checks that the braces only contain valid characters for a
} parameter ID, so the only likely clash with this syntax is for avid
} users of the BRACE_CCL option where {myfd}>~/tmp/logfile would perform a
} normal redirection

Perhaps setopt BRACE_CCL should simply disable/override this behavior?



Messages sorted by: Reverse Date, Date, Thread, Author