bug-bash
[Top][All Lists]
Advanced

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

Re: Closing File Descriptors


From: Davy Durham
Subject: Re: Closing File Descriptors
Date: Wed, 28 Apr 2004 15:29:21 -0400
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040115


If you want to close fd 3 you need to use `exec 3<&-'.  That makes the
redirections persist in the current shell environment.


Very much thank you.. I would have never guess that...

Is this in the man page somewhere? (Perhaps is implicit)

I see that in the description for exec that if no command is specified then redirections will take place in the current shell, but that doesn't imply that you have to use exec to make them persist (unless the "3>&-" by itself is seen as a new command to execute and thus a forked process, but exec would seem to imply that the current process is about to be replaced).. that's really nasty. Perhaps something should be mentioned in the section on REDIRECTION about this.


Thanks again!

-- Davy





reply via email to

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