I need to get /mysqlsharedetails from all the MySQL servers.
I have written a script using a while read loop, but it's getting the details of only the first server,
#!/bin/ksh
file="/home/mysqladm/server_list/server_list.txt"
# while loop
while IFS= read -r a
do
# display line or do something on $line
output=`ssh $a df -h | grep mysqlshare`
#echo $a,$output
echo $a ,$output >> /home/mysqladm/server_list/output.txt
done < "$file"
I have server_list.txt file in which there are two servers like,
server_name1,
server_name2,
it's going to server_name1 and doing df -h and getting out of script.
Why is the loop not working?