Trying a arithmatic on a command line vs scripting.

Hi Everyone!
I'm trying to do simple math on a single command line instead of a script which I've already set up using let etc. I can not get the same output to display on a command line.

Essentially I would like a=20, b=50, and c=a*b.

When I tried:
let "A=20, B=50"; let C=A*B; echo $C

I got the answer but the following error message:
-bash: let: 1000=AB; attempted assignment to non-varible (error token is "=AB")

I didn't know if that meant to add quotes in the formula...so i tried that and it didn't work either. Where am i making the mistake?

Thanks so much!

Try this:

A=20
B=50
C=$(( $A * $B ))
echo $C

Have a read of a scripting tutorial:

http://www.unix.com/answers-frequently-asked-questions/13774-unix-tutorials-programming-tutorials-shell-scripting-tutorials.html

Regards

Worked perfectly!

Thanks again