I'm trying to SSH into a bunch of hosts in order, and run a command to get a list of users on each one. Outside of a for loop, the output shows up just fine one-by-one. Inside a for loop, it disappears. How do I make that output visible?
#!/bin/bash
#grab a bunch of IP addresses from a file
for address in $(cat ip_list.txt)
do
#output for this shows up.
echo "connecting to $address";
#output for this does not
sshpass -p 'password' ssh account@$address "echo $address;dscl . list /Users | grep -v '^_\|nobody\|daemon\|admin\|root'; exit"
done