Quantcast
Channel: Active questions tagged expect - Unix & Linux Stack Exchange
Viewing all articles
Browse latest Browse all 158

How to limit parallel jobs

$
0
0

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..


Viewing all articles
Browse latest Browse all 158

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>