..

Custom File Descriptors

$ echo "This is an input test" > test.txt
$ exec 3< test.txt
$ cat <&3
This is an input test
$ exec 4> test.txt
$ echo "This is a truncate write test" >&4
$ cat test.txt
This is a truncate write test
$ exec 5>> test.txt
$ echo "This is an append write test" >&5
$ cat test.txt
This is a truncate write test
This is an append write test
$ exec 3<&-
$ exec 4<&-
$ exec 5<&-

References