Anyone here used pssh to modify files in place, I've tried attempts like so;
while read line;
do
pssh --inline-stdout -H "$line" "hostname;
sudo sed -i \'s/search domain123.local/search domain123.local domain456.local/g\' /etc/resolv.conf;
sleep 1";
done < <(cat listOfIPs.txt)
Although pssh returns Success status, it doesn't amend resolv.conf on the actual host - am I missing something obvious in the pssh or sed command?
Thanks!
I found by altering the quotes, from single to double in the sed part, it seemed to fix it:
And I also removed the
/g
but I don't think that really made a diff