4

Executing remote commands via ssh

view full story
linux-howto

http://www.unix.com – Hi, I'm tryin to write a script that will collect information about a remote servers, put them into variables and print them to screen. Code: # /usr/bin/bash ls $1 > /dev/null 2>/dev/null if [ "$?" -eq 0 ] then   echo "$1 is file"         for server in $(cat $1)         do #      echo $server                 ssh -T $server /bin/bash -s <<EOF               HOST1=$(hostname)    #1     &nb (HowTos)