Closes the file descriptor (fd)

From Linux Shell Scripting Tutorial - A Beginner's handbook
Jump to: navigation, search
← Assigns the file descriptor (fd) to file for inputHomeOpening the file descriptors for reading and writing →

To closes the file descriptor use the following syntax:

exec fd<&-

To close fd # 5, enter:

exec 5<&-