save remote files to array

n=0; for i in `cat ttt` ; do readarray arr$n < <(ssh $i 'cat /etc/passwd'); n=$(( $n + 1 )) ; done

printf '%s\n' "${#arr0[@]}"
20
printf '%s\n' "${#arr1[@]}"
26

Leave a Reply

Your email address will not be published. Required fields are marked *