Linux Today: Linux News On Internet Time.

Reading Multiple Files with Bash

Aug 22, 2009, 20:04 (1 Talkback[s])
(Other stories by Mitch Frazier)

"Notice the input redirection to read uses another special form that includes the ampersand (&) to specify that what follows is a file descriptor and not a file name.

"Use file descriptors in the range 3-9. File descriptors below 3 are used for standard input, output, and error, the ones above 9 may be used by the shell internally.

"Although there is no explicit syntax for closing a file, re-using the file descriptor will close the file before opening the new file. To be safe you could do the following to close the files:"

Complete Story

Related Stories: