In the fourth snippet, we use a functionality of the exec command which opens a file and uses the number (3 in this case) as the file descriptor. This file descriptor is used at the end of the while. It is important to add the & in front of the file descriptor.

All the cases will work generally. There is one case in which it will not work: when a value is read inside the loop.

In the sixth snippet, we use the -u option which is for specifying the file descriptor that needs to be used for the corresponding read. We specify that the first read is for reading from descriptor 3, while the second read is for reading from descriptor 0. Note that the redirection at the end of the loop is not necessary.