while read -u 3 foo; do process $foo; done
Now this works, if the command line looks like this:
script 3< input_file
But he wants to set up the file descriptor within the script.
Can it be done? Is there another way to iterate over the
lines in a file using only bash?
Thanks,
Tobiah
I finally found a description of how to do this. The
answer is to use 'exec':
exec 3< file_name
creates a new descriptor which can be used with read.
read <&3 myline