[ale] bash script problem

ale list ale at gurlhax0r.org
Fri Dec 15 14:35:03 EST 2006



Jim Popovitch wrote:
> Below is a small script

Make it a shell function:

#!/bin/sh

function CMD
{
if [ -e /var/lib/clamav/daily.cvd ]; then
     ls -al /var/lib/clamav/daily.cvd
else
     echo
fi
}

me=`hostname`

for host in `cat ~/.hosts`; do
    echo -n "$host       ";
    if [ $host = $me ]; then
         CMD
    else
        ssh $host CMD
    fi
done

--
Tina



More information about the Ale mailing list