Hey Everyone,
On SLEDs here and need some quick troubleshooting with my script. Wanting to SSH into a large number of desktops, get their repos they currently have and remove them all.
Here's what I have so far:
Code:
#!/bin/bash
hosts='donkey'
for host in $hosts; do
echo "Connecting to host $host"
sudo ssh $host "$(zypper repos | grep Yes | cut -f3 -d '|' | sed -e 's/ //') | awk '{ print "zypper rr " $1 }'";
done
I get the output:
Code:
Connecting to host donkey
bash: line 1: Repo1 command not found
bash: line 2: Repo2 command not found
bash: line 3: Repo3 command not found
bash: line 4: Repo4 command not found
(I renamed the repo names for confidentiality purposes)
Thanks