[ale] shell scripting baby questions...

Geoffrey esoteric at 3times25.net
Fri Feb 20 13:30:35 EST 2004


Nathan J. Underwood wrote:
> 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

Generally, you'll get an error if the variable is unset and not enclosed 
in quotes because the shell will see: [ -eq 0 ]

Although I don't do bash, I believe you want '-eq' not 'eq'


-- 
Until later, Geoffrey                     Registered Linux User #108567
Building secure systems inspite of Microsoft



More information about the Ale mailing list