On Sunday 14 December 2008 11:06:39 Mick wrote:
> md5sum -c token*.md5sum are the easiest on this occasion, although Alan's
> last two commands are indeed "insanely useful"! ha! They will be saving
> me hours of typing in the future. :)
That's why I suggested them :-) I use them a lot, especially when I have to
run the same set of commands on 15 different hosts, then I do something like:
for I in $(seq 1 15) ; do scp package.tar.gz a...@host${i}.domain.com ; done
for I in $(seq 1 15) ; do ssh a...@host${i}.domain.com tar xvzf
package.tar.gz ; done
You can get real cute and put the host name and commands into files (one
command/host) per line and run it all as two nested for loops:
while read -u hostfile HOST ; do while read -u commandfile COMM ; do ssh
a...@${host} ${COMM} ; done ; done
That's off the top of my head, it'll need some parenthesis to make it actually
work otherwise bash gets confused with too many ";"s but you get the idea. A
running ssh-agent in these cases is recommended too :-)
--
alan dot mckinnon at gmail dot com