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

Re: exec 3< in interactive shell



Boyd Adamson wrote:
> Is there some reason that exec 3< somefile fails in an intereactive  
> shell, while working in a script?

Some systems open additional file descriptors in that area for their own
purposes: some versions of Solaris, for example.  zsh keeps explicitly
opened private file descriptors at 10 or above, but there may be things
it doesn't no about.

If you have it, lsof should give you some clue what the file descriptor
is for.

> I often find myself trying to demo the ability to open file  
> descriptors, but I have to keep remembering to leave zsh to do it.  
> The horror!

Maybe you know, but the latest shell allows

% exec {fd}<somefile
% echo $fd
12

-- 
Peter Stephenson <pws@xxxxxxx>                  Software Engineer
CSR PLC, Churchill House, Cambridge Business Park, Cowley Road
Cambridge, CB4 0WZ, UK                          Tel: +44 (0)1223 692070


To access the latest news from CSR copy this link into a web browser:  http://www.csr.com/email_sig.php



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