I read file, but data of array exist only in loop. At the end of code i try to echo tab[3], but it is empty.
ls -t > lista.txt
N=$(wc -l lista.txt)
N=${N:0:1}
tab[$N]=0
let I=0
while read line
do
tab[$I]="$line"
echo ${tab[$I]}
((I+1))
done <lista.txt
echo ${tab[3]} #no Value