[mrtg] Need Bash help

Max Kipness II mkipness at aztechsolutions.com
Thu Mar 21 03:03:54 MET 2002


Hello All,
 
I've created a script that monitors the response time (latency) of DNS
servers and creates an MRTG graph out of it. I've got  most of it ironed
out, but am having a problem with multiplication in the script. The
bottom line is that I can't figure out how to multiply a decimal value.
I have posted below only a sample of the operation I'm trying to do
rather than the whole script. Here it is:
 
#!/bin/bash
ARG2=.2
echo $(( 100 * $ARG2 ))
 
This reports back an error. If you simply change it to read ARG2=2
(without the decimal), it works fine.
 
Is there any way around this?
 
I know there will be a lot of people that will want to say, 'Just use
Perl'. If I have to I will, but does anybody have the solution for Bash?
 
Thanks,
Max

--
Unsubscribe mailto:mrtg-request at list.ee.ethz.ch?subject=unsubscribe
Archive     http://www.ee.ethz.ch/~slist/mrtg
FAQ         http://faq.mrtg.org    Homepage     http://www.mrtg.org
WebAdmin    http://www.ee.ethz.ch/~slist/lsg2.cgi



More information about the mrtg mailing list