I have some problems writing scripts ... if someone can help me, it will be really good!
My script has:
VISITS=$((WR + RD));
SERVICE_DEMAND=$((VISITS*SERVICE_DEMAND));
And I get this error:
./calc_serv_demand.sh: line 12: 0.0895406: syntax error: invalid arithmetic operator (error token ".0895406")
Can someone help me?
I think because bash only works with an integer ... I need to use float values.
early
Problem resolved:
VISITS = $ (echo $ WR + $ RD | bc); echo $ VISITS
SERVICE_DEMAND = $ (echo $ VISITS '*' $ SERVICE_TIME | bc); echo $ SERVICE_DEMAND
source
share