View Single Post
  #2   (View Single Post)  
Old 20th January 2009
phoenix's Avatar
phoenix phoenix is offline
Risen from the ashes
 
Join Date: May 2008
Posts: 696
Default

Start a Bourne shell (sh, bash, zsh) and use the for loop:
Code:
# for server in $( cat /path/to/serverlist ); do
scp /path/to/load_checker.sh user@${server}:/some/directory/
done
The $( ) construct tells the shell to run the command(s) between the $( ) and to substitute the values in place of the $( ).

The for loop will replace ${I} with each value returned by $( ).
__________________
Freddie

Help for FreeBSD: Handbook, FAQ, man pages, mailing lists.

Last edited by phoenix; 21st January 2009 at 06:36 PM. Reason: Fix typo in for loop, using $I instead of $server
Reply With Quote