#!/bin/bash tooldir=/usr/local/bin toollist="zip unzip" # distribute to hosts in file nehosts while read line do if [[ "$line" =~ ^[^[:space:]]*# || -z "$line" ]]; then continue fi user=`echo $line | cut -d " " -f 2` ip=`echo $line | cut -d " " -f 1` passwd=`echo $line | cut -d " " -f 3` for toolname in $toollist;do expect <