Before I go any further, the addition of [[:space:]] was to discriminate on word boundary. When the CLAMAVCONF file has entries like this :
StreamMaxLength 25M LogFileMaxSize 0 LogFile /var/log/clamav/clamav.log
the grep could not discriminate b/w LogFileMaxSize & LogFile, so the LogFile variable ended up with 0.
Revisiting the expression, I think that using \b would be more appropriate to discriminate on word boudaries so the expression would be :
value=`grep "^$variable\b" $CLAMAVCONF | head -n1 | awk '{print $2}'`
Unless you see an issue with this, I will go ahead with that fix, since the [[:space:]] was not intended to identify single space, but word boundaries
« Back to merge proposal
Before I go any further, the addition of [[:space:]] was to discriminate on word boundary. When the CLAMAVCONF file has entries like this :
StreamMaxLength 25M clamav/ clamav. log
LogFileMaxSize 0
LogFile /var/log/
the grep could not discriminate b/w LogFileMaxSize & LogFile, so the LogFile variable ended up with 0.
Revisiting the expression, I think that using \b would be more appropriate to discriminate on word boudaries so the expression would be :
value=`grep "^$variable\b" $CLAMAVCONF | head -n1 | awk '{print $2}'`
Unless you see an issue with this, I will go ahead with that fix, since the [[:space:]] was not intended to identify single space, but word boundaries