I'm using the following script to loop through a list of servers then output free disk space info. SSH keys are already in place and working.
But it's only outputting the first server name, then existing...I'm stumped.
#!/bin/bash
PATH=/bin:/usr/bin:/usr/sbin
export PATH
while IFS='|' read hostname nickname; do
echo "$hostname: $nickname"
ssh $hostname "df -Pkhl"
done < server-list.dat
And the list:
% cat server-list.dat
serverone|ONE
servertwo|TWO
serverthree|THREE