Using the read command on a file descriptor (fd)

We can use the read command to get data from a file to store it in variables. The procedure for using the read command to get a text from a file is as follows:

    read -u fd variable1 variable2 ... variableN
  

Get Learning Linux Shell Scripting - Second Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.