Nathan_200sx
19-03-2003, 14:45
How the hell do you multiply a variable in a bash script?
I've tried this
a=$(tail -100 /var/log/messages |grep -c a)
b=$((a*5))
echo b
but I just get back *5 : syntax error operand expected : (error token is "*5")
I dont realy neead to count how many "a's" there are in the last 100 lines of messages and times it by 5 I just need to find out how to multiply a variable from within a script :mad: :mad:
I've tried this
a=$(tail -100 /var/log/messages |grep -c a)
b=$((a*5))
echo b
but I just get back *5 : syntax error operand expected : (error token is "*5")
I dont realy neead to count how many "a's" there are in the last 100 lines of messages and times it by 5 I just need to find out how to multiply a variable from within a script :mad: :mad: