[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[ale] bash script problem
Charles Shapiro wrote:
> Uuh, except I don't think "host" is gonna know the word "CMD".
Try this, it appears to work. Note the double quotes around CMD in the
ssh command:
#!/bin/sh
CMD="if [ -e /var/lib/clamav/daily.cvd ]; then
ls -al /var/lib/clamav/daily.cvd
else
echo
fi"
me=`hostname`
set -x
for host in `cat ~/.hosts`; do
echo -n "$host ";
if [ $host = $me ]; then
$CMD
else
ssh $host "$CMD"
fi
done
--
Tina