0

I have a simple file (test.ini) with a variable:

v2="1"

And in script I try to do arithmetic operation on the loaded variable and I always get an 'invalid arithmetic operator'.

Script:

#!/bin/bash

# Works as it should.
v1="1"
echo "$((v1+1))"

# Throws ")syntax error: invalid arithmetic operator (error token is ".
source "test.ini"
echo "$((v2+1))"

I'm running this on Centos 7 and bash 4.2.46(2)-release.

I searched around the Google and couldn't find anything similar. Any help is really appreciated.

Br Waldemar

Waldemar
  • 143
  • 8

0 Answers0