Why won't my Ksh do math with (( ))?

Hello,

I'm usring Ksh on AIX 5.3. For some reason my K-Shell gives me an error when I try to use the math operators (( )).

Can anyone tell me what's going on and how to fix it?

Thanks so much!

My K-Shell:

/>ls -al /usr/bin/ksh
-r-xr-xr-x   5 bin      bin          237420 Apr 10 2007  /usr/bin/ksh

Commands:

 
/>myvar=$ (( 1 + 1 ))
ksh: syntax error: `(' unexpected
 
/>myvar=`expr 1 + 1`
/>echo $myvar
2
 
/>let myvar=$ (( 1 + 1 ))
ksh: syntax error: `(' unexpected

Hi.

What's with the space between $ and (

Remove that and try again.

x=1
x=$ ((x+1))
-ksh: syntax error: `((' unexpected
x=$((x+1)) 
echo $x
2

I was following the example in this post. It looked like there was a space after the $ and before (( at first glance. It worked after I removed the space.