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

Start a Bourne shell (sh, bash, zsh) and use the for loop:
# for server in $( cat /path/to/serverlist ); do
scp /path/to/ user@${server}:/some/directory/
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 $( ).

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