list=hosts-SiebelCRM.list; i=1; count=`wc -l $list | awk '{print $1}'`; for host in `cat $list`; do echo "----- $host : [$i] of $count -----"; scp ~/scripts/parse-syslog.pl $host:.; i=`expr $i + 1`; done
Friday, December 11, 2009
SCRIPT - bash - Loop through a list of hosts and display index count
In this example, we are looping through a list of hosts specified in a given file and copying a script to each host :
Subscribe to:
Post Comments (Atom)

No comments:
Post a Comment