How to get variable from other while loop?
===

    #!/bin/bash
    
    read()
    {
        count=0
        cat localfile |
        while read line
        do
            FILE[$((count += 1))]="$line"
        done
    }
    
    read
    for((i=0;i<${#FILE[@]});i++)
    do
        echo ${FILE[i]}
    done

The result of echo is whole blank. Is there any way to get the FILE array?