Shell Scripting

Asked by zelenytsya

Hi. I have a shell script with the following lines:

#!/bin/sh
echo "I will work out X*Y"
 echo "Enter X"
 read X
 echo "Enter Y"
 read Y
 echo "X*Y = $X*$Y = $[X*Y]"

and result:

petro-z@petro-z-desktop:~$ ./myfile.sh
I will work out X*Y
Enter X
2
Enter Y
3
X*Y = 2*3 = $[X*Y]

where 6? or how receive 6?

Question information

Language:
Russian Edit question
Status:
Solved
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Solved by:
Ilya Voronin
Solved:
Last query:
Last reply:
Revision history for this message
Best Ilya Voronin (ivoronin) said :
#1

echo $((X*Y))

Revision history for this message
zelenytsya (petro-z) said :
#2

Thank you.

Revision history for this message
zelenytsya (petro-z) said :
#3

Thanks Ilya Voronin, that solved my question.