Calculating the power in bash

I'm pretty new to bash scripting. I'm trying to work out calculations, and what I'm specifically trying to do is write a script that allows me to enter a parameter, and that my script calculates the power of 2 to that parameter.

So say I would try

bash scriptname 3

My script would calculate 2^3=8

I'm trying with

(( 2 ^ $1 ))

but that's not doing anything. Is there a command to calculate the power of something that I'm not aware of?


The power operator in bash is **


echo $((2 ** 4))