Script only processes 1st Line of input file

bash script to read a file and process commands remotely. It currently only processes the first line (server1)

Need to remotely process 3 commands on server1 , then server2 ......

#!/bin/bash

while read line; do
sshpass -f password ssh -o StrictHostKeyChecking=no user@$line zgrep “^A30=” /var/tmp/logs1/messages.* | >> Output.txt
sshpass -f password ssh -o StrictHostKeyChecking=no user@$line zgrep “^A30=” /var/tmp/logs2/messages.* | >> Output.txt
sshpass -f password ssh -o StrictHostKeyChecking=no user@$line zgrep “^A30=” /var/tmp/logs3/messages.* | >> Output.txt
done < file1

file1:

server1
server2
server3


#bash #linux

2 Likes2.20 GEEK