This page uses adding packages as a specific example of performing a task on multiple machines. The use of rsh and loops for other tasks should be straight forward.
If you need to install a new package on all of the machines in the lab (or even some subset), the standard method of logging into each machine and using /stand/sysinstall to select the package can be tedious (40 logins!) Instead, you can use rsh, pkg_add, and the shared file-system to greatly reduce the tedium. Tip:Always use full pathnames for all programs with rsh.
When you're ready to install the package on the remote machine, login to the master machine (goldbergP137), 'su' to root and use rsh. For example (untested):
rsh howard138 "cd /usr/src/packages; /usr/sbin/pkg_add emacs19.34b.tgz"should install emacs on howard138. To install the package on multiple machines you could do something like (untested):
foreach machine ( howard138 lovey138 speedy138 petunia138 ) rsh $machine "cd /usr/src/packages; /usr/sbin/pkg_add emacs19.34b.tgz" end
If the command for installation is too complex, you can simply create a script (e.g. /usr/src/bin/add_pkgs) and use
rsh $machine /usr/src/bin/add_pkgs
The value of having a script that simply loops through a list of machines executing a command or script through rsh should be apparent.