Entering edit mode
3.1 years ago
82101202089
▴
10
when I do something like this,I got a question:
yi@yi:~$ cat ids.txt
CDS
chromosome
exon
five_prime_UTR
gene
mRNA
scaffold
three_prime_UTR
# this way has a result
yi@yi:~$ while read line; do arr1[++i]=$line;done < ids.txt
yi@yi:~$ echo ${arr1[@]}
CDS chromosome exon five_prime_UTR gene mRNA scaffold three_prime_UTR
# but this one -- nothing!!!
yi@yi:~$ cat ids.txt | while read line;do arr2[++i]=$line;done
yi@yi:~$ echo ${arr2[@]}
yi@yi:~$
why!!!!