I am having problems with my script. When I run the script, it works. But it connects to a single server. iplist.txt is connecting to the first IP address field. It is not connected to other servers. I do not know where I'm doing wrong. Can you help me ?I have studied and applied many questions that have been asked before. But the result is the same again.I want to use this script for different purposes in the future. I have a 140 linux servers and have zabbix agent. But zabbix agents on the servers are out of date. My Script;#!/bin/bash#set -xservers=/Users/spala/works/iplist.txt#set -uwhile read -u140 multiplessh;doUSER=testuserPASS=testpasswordPORT=55022current_ver=3.2.3command1=/usr/sbin/zabbix_agentd -V & hostname -f /dev/nullconnection_method=`/usr/local/bin/sshpass -p $PASS /usr/bin/ssh -n -p$port -o StrictHostKeyChecking=no $user@$multiplessh $command1`first_step=$connection_method###result=$(echo $first_step |grep 'zabbix_agentd\|.spala' | awk '{print $1, $5}')# - 'zabbix_agentd' ---> zabbix_agent -V command output..# - '.spala' my server hostname fqdn..--> test.spala test1.spala test2.spalahostname=$(echo $result |awk '{print $1}')version=$(echo $result |awk '{print $2}')if [[ $version == $current_ver ]]then   echo $hostname used version ---> $version   echo Version is ok...   exit 1else   echo $hostname used version ---> $version   echo Old version.. Need update !   exit 1fiexit 0done 140<$serversscript results;sh test.shtest1.spala used version ---> 3.2.2Old version.. Need update !my iplist file;cat /Users/spala/works/iplist.txt1.1.1.12.2.2.23.3.3.34.4.4.45.5.5.5...total 140 servers
shell script - multiple ssh connection
shell script;ssh
Notice the exit 1 and exit 0 lines in your script? They explicitly stop the script. You probably copied this from somewhere else that was intended to be run as a standalone file, but in your case it just means that the script will exit after connecting to the first IP.Granted, this isn't how you should be aiming to do this.do not use sshpass for daily operations. Use it once to set up key authenticationconsider using system management tools like Puppet, Chef and many, many othersconsider using proper packages, then you can use the package management tools to verify the version. Also, use package repositories for easy upgrade management