[ale] shell scripting baby questions...
Yu, Jerry
jerry.yu at Voicecom.com
Fri Feb 20 12:28:20 EST 2004
You may want to delete only if the tar finished succsfully:
tar -czf $logName.tgz $logName && rm -f $logName;
-----Original Message-----
From: Keith Morris - IQ [mailto:keith at iqtv.com]
Sent: Friday, February 20, 2004 12:13 PM
To: Atlanta Linux Enthusiasts
Subject: Re: [ale] shell scripting baby questions...
Thanks everyone!!! you rock. Here was the solution:
# if no virii were detected, deltet infected log file.
if [ $infectionsDetected -eq 0 ]
then
rm -f $logPath/$infectedLogName;
fi
# tar and gzip the scan logfile and remove the uncompressed log
cd $logPath
tar -czf $logName.tgz $logName;
rm -f $logName;
Johnny Preyer wrote:
> and eq should be -eq, eq is used in perl for string equality comparison,
> isn't it?
>
> -----Original Message-----
> From: Nathan J. Underwood [mailto:lists at cybertechcafe.net]
> Sent: Friday, February 20, 2004 11:15 AM
> To: Atlanta Linux Enthusiasts
> Subject: Re: [ale] shell scripting baby questions...
>
>
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Ok, I'm gonna step out on a limb here. Do you need the quotation marks
> around the 0 in this case? Also, should the variable name have quotes
> around it?
>
> ~ if [ "$infectionsDetected" eq 0 ]
> ~ then
> ~ rm -f $logPath/$infectedLogName
> ~ fi
>
> nathan
>
--
:: Keith Morris
:: Creative Director
:: Design / Effects
:: IQ television group
:: Atlanta, GA
:: 404.255.3550
:: http://www.iqtv.com
_______________________________________________
Ale mailing list
Ale at ale.org
http://www.ale.org/mailman/listinfo/ale
More information about the Ale
mailing list