[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[ale] bash script problem
- Subject: [ale] bash script problem
- From: ale at gurlhax0r.org (ale list)
- Date: Fri, 15 Dec 2006 17:22:43 -0500
- In-reply-to: <1166219088.19125.63.camel@localhost>
- References: <1166207427.19125.7.camel@localhost> <[email protected]> <[email protected]> <[email protected]> <1166219088.19125.63.camel@localhost>
Jim Popovitch wrote:
> On Fri, 2006-12-15 at 16:23 -0500, ale list wrote:
>> 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:
>
> :-) That works for ssh, but the "if" error is back for the local system.
> Strange that #!/bin/sh (and even #!/bin/bash) doesn't work.
>
> Still, thanks for the suggestions.
Then I think I'd change it to this :)
#!/bin/sh
CMD="if [ -e /var/lib/clamav/daily.cvd ]; then
ls -al /var/lib/clamav/daily.cvd
else
echo
fi"
for host in `cat ~/.hosts`; do
echo -n "$host ";
ssh $host "$CMD"
done
--
Tina