I have a hosts containing file say /tmp/hostlist
which requires username & password to login and I am using expect command to login hosts and execute command and come out like below in my bash script.
)VAR=$(expect -c "$script")echo "$VAR" >/tmp/outexp-----------------
I am able to handle parallel execution -
while IFS= read -r ido ( export server_name=`echo $i`;echo "connecting to $i";expect -c wait
Is there a way to limit no. of hosts at a time? e.g suppose i have 1000 hosts in a file..and i want to execute in a set of 100 hosts at a time to complete 1000 hosts..