You are using the $sign in a left assignment statement, which is not what you expect.
Please change your line
$a = `expr $a + 1` ;
to
a=`expr $a + 1`;
And also be warned that spaces before and after =
sign shouldn't be used in bash scripts
UPDATE:
This code does work without syntax errors with bash or sh:
a=23
while [ $a -lt 45 ]; do
a=`expr $a + 1`
echo "the new value is $a"
done
And prints:
the new value is 24
the new value is 25
the new value is 26
the new value is 27
the new value is 28
the new value is 29
the new value is 30
the new value is 31
the new value is 32
the new value is 33
the new value is 34
the new value is 35
the new value is 36
the new value is 37
the new value is 38
the new value is 39
the new value is 40
the new value is 41
the new value is 42
the new value is 43
the new value is 44
the new value is 45