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: Chet Ramey
Subject: Re: Equivalent of ksh, zsh {N}<[WORD] ?
Date: Tue, 26 Aug 2008 11:55:13 -0400
User-agent: Thunderbird 2.0.0.16 (Macintosh/20080707)

R. Bernstein 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
> 
> will duplicate stdin and save the newly allocated file-descriptor
> number to fd. Also:
> 
>    exec {fd}<filename
> 
> opens filename with a new file descriptor and saves the number
> allocated in fd. Short of going outside of the language and using
> lsof, /proc, or the processes table, I haven't been able to figure out
> how to do the corresponding thing in bash. Is there a way?

There's no current way to do this -- it's a new feature.  It's on the
list of possible future enhancements, but I haven't yet seen a
compelling enough case as to its value to make it a priority.

Chet
-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer

Chet Ramey, ITS, CWRU    address@hidden    http://cnswww.cns.cwru.edu/~chet/




reply via email to

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