can you please tell me why this is not working? only the add 'e f' after the read loop is done, but not the multiple adds 'q w' inside the read loop. regards stefan
vuser1@vpc1:~$ echo ${#a[@]}
1
vuser1@vpc1:~$ ls
Desktop Documents Downloads Music Pictures Public Templates Videos
vuser1@vpc1:~$ set -x
vuser1@vpc1:~$ a=();ls -l|while read x; do a+=("q w");done;a+=("e f")
+ a=()
+ ls --color=auto -l
+ read x
+ a+=("q w")
+ read x
+ a+=("q w")
+ read x
+ a+=("q w")
+ read x
+ a+=("q w")
+ read x
+ a+=("q w")
+ read x
+ a+=("q w")
+ read x
+ a+=("q w")
+ read x
+ a+=("q w")
+ read x
+ a+=("q w")
+ read x
+ a+=("e f")
vuser1@vpc1:~$ echo ${#a[@]}
+ echo 1
1
vuser1@vpc1:~$ echo ${a[@]}
+ echo e f
e f
vuser1@vpc1:~$```