[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[no subject]
- <!--x-content-type: text/plain -->
- <!--x-date: Fri Feb 27 12:31:11 2004 -->
- <!--x-from-r13: qrrcofq ng rneguyvax.arg (Rnivq E. Xnpxfba) -->
- <!--x-message-id: [email protected] -->
- <!--x-reference: [email protected] --> "http://www.w3.org/TR/html4/loose.dtd">
- <!--x-subject: [ale] shell scripting baby questions... -->
- <li><em>date</em>: Fri Feb 27 12:31:11 2004</li>
- <li><em>from</em>: deepbsd at earthlink.net (David S. Jackson)</li>
- <li><em>in-reply-to</em>: <<a href="msg00743.html">[email protected]</a>></li>
- <li><em>references</em>: <<a href="msg00743.html">[email protected]</a>></li>
- <li><em>subject</em>: [ale] shell scripting baby questions...</li>
Just FYI, you don't really need the ';' at the end of each line like
you do in perl. I don't think it does any harm, except that it might
confuse you or someone else looking over your source. You might
start putting spaces in variable assignments like: blah = "whatever";
as you would in perl! :-)
> # update virus defs
> /opt/bdc/bdc --update;
>
> # run virus scan with logging
> /opt/bdc/bdc --arc --disinfect --log=$logPath/$logName $dirToScan;
>
> # list all found infected files into an infected log
> cat $logPath/$logName | grep infected: > $logPath/$infectedLogName;
>
> # find out if there were any found infections
> infectionsDetected=`cat $logPath/$infectedLogName | wc -l`;
>
> # if no virii were detected, deleted infected log file.
> # *!!! this ain't workin' !!!*
>
> if [ $infectionsDetected eq "0" ]
you heard about -eq not eq...
> then
> rm -f $logPath/$infectedLogName
you could shorten this if clause to
[ -z "$infectionsDetected" } && rm -f $logPath/$infectedLogName
I think it would be a little more efficient.
> fi
>
> # tar and gzip the scan logfile and remove the uncompressed log
> tar -czf $logPath/$LogName.tgz $logPath/$infectedLogName;
> rm -f $logPath/$logName;
[ -f "$logPath/$logName" -a -w "$logPath/$logName" ] && rm $logPath/$logName
Just to get into the habit of checking files before you operate on
them.
Nice script!
--
David S. Jackson dsj at dsj.net
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
A door is what a dog is perpetually on the wrong side of.
-- Ogden Nash
</pre>
<!--X-Body-of-Message-End-->
<!--X-MsgBody-End-->
<!--X-Follow-Ups-->
<hr>
<ul><li><strong>Follow-Ups</strong>:
<ul>
<li><strong><a name="01078" href="msg01078.html">[ale] shell scripting baby questions...</a></strong>
<ul><li><em>From:</em> esoteric at 3times25.net (Geoffrey)</li></ul></li>
</ul></li></ul>
<!--X-Follow-Ups-End-->
<!--X-References-->
<ul><li><strong>References</strong>:
<ul>
<li><strong><a name="00743" href="msg00743.html">[ale] shell scripting baby questions...</a></strong>
<ul><li><em>From:</em> keith at iqtv.com (Keith Morris - IQ)</li></ul></li>
</ul></li></ul>
<!--X-References-End-->
<!--X-BotPNI-->
<ul>
<li>Prev by Date:
<strong><a href="msg01074.html">[ale] HTML font setting for kmail?</a></strong>
</li>
<li>Next by Date:
<strong><a href="msg01076.html">[ale] ALE Barbecue!</a></strong>
</li>
<li>Previous by thread:
<strong><a href="msg00759.html">[ale] shell scripting baby questions...</a></strong>
</li>
<li>Next by thread:
<strong><a href="msg01078.html">[ale] shell scripting baby questions...</a></strong>
</li>
<li>Index(es):
<ul>
<li><a href="maillist.html#01075"><strong>Date</strong></a></li>
<li><a href="threads.html#01075"><strong>Thread</strong></a></li>
</ul>
</li>
</ul>
<!--X-BotPNI-End-->
<!--X-User-Footer-->
<!--X-User-Footer-End-->
</body>
</html>