Fairly long time reader, first time poster. I am not a scripter (yet) but I understand/know some basics. Not all the basics, but some.
I've been doing lots of searching but have not found my particular case just yet.
What I'm doing is writing up a script to send multiple rpm files to multiple systems, then remotely executing the rpm installation command and repeat on to the next system.
I have a plain text file that contains a list of the systems (sites.txt). The list of systems are laid out like this in the file:
0123 aa0123
4567 aa4567
8910 aa8910
etc...
I want to use this list to pass to the SCP/SSH commands to send the RPM files, then to execute the rpm installation. But I'm not exactly sure how to go about getting the same command to repeat until the list of systems (sites.txt) has run through.
To give more of an idea of what I'm trying to do, here is what I have in the script so far:
for i in cat /tmp/sites.txt | awk '{print $2}'
do
REG='expr substr $i'
(Is this needed?)
scp /remote/install/* $i:/remote/install; ssh $i "rpm -U /remote/install/*'
Thats what I've got so far.
Any help/advise would be greatly appreciated as I'm not very strong with scripting.
Thanks!