1

Reading files in a directory into a Kornshell array.

view story
linux-howto

http://www.linuxquestions.org – So I'm trying to get the filenames in a directory read into an array over ssh. The way I'm currently doing it is as follows: Code: set -A file_array $(ssh [email protected] ls /home/example/directory) typeset -L14 filename typeset -i idx=0 typeset -i total=0 total=$(ssh [email protected] ls /home/example/directory | wc -l)-1 while [[ $idx -le $total ]] do     filename=${file_array[$idx]} done So the question isn't why this doesn't work, but why it does. Everything makes relative sense to me, other than the -L14 flag in line two. I did some googling (though admittedly it was (HowTos)