|
Put a few lines of data in a file called test.file. Try this loop style:
cat test.file | while read line
and the array will be empty after the loop ends. Then try:
exec < test.file
while read line
and the array will have data after the loop ends. The while loop is being placed in a subshell if it is in a pipeline. ksh will not do that but other shells do.
|