On 12/1/12 1:00 AM, Dan Douglas wrote: > > I believe one of the motivations for named FDs other than automatic FD > allocation, and the reason they remain open, was probably to deal with > organizing and grouping coprocesses so that you could follow the variable > names rather than the FDs directly due to the somewhat awkward way they are > manipulated.
That's a good point. I think that the general idea is to expose abstractions that are closer to the underlying OS -- which, face it, is Unix -- model. That's part of the idea behind the COPROC array, which is close to the pipe(2) model. The other issue, which I'm surprised nobody has mentioned so far, is that this is the only way ksh allows programmers to use file descriptors greater than 9. That's never been an issue for bash: it has always allowed multi-digit file descriptor specifications. ksh has maintained 30+ years of backwards compatibility and only allows redirections to specify file descriptors 0-9. Chet -- ``The lyf so short, the craft so long to lerne.'' - Chaucer ``Ars longa, vita brevis'' - Hippocrates Chet Ramey, ITS, CWRU c...@case.edu http://cnswww.cns.cwru.edu/~chet/