bug-bash
[Top][All Lists]
Advanced

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

Closing File Descriptors


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

Any idea why doesn't this code close fd 3 like I think the man page says it should under the "REDIRECTION.Duplicating File Descriptors" section

(linux 2.4's /proc file system)




#!/bin/bash

while read -u 3 foo
do
       ls -al /proc/$$/fd
       echo $foo

       3<&-
done 3< /etc/hosts



Thanks...




reply via email to

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