Hi
I need help in this lab question, I have got correct result but lab is marking my answer as incorrect.
question: Create a shell script called /home/bob/calculate-price.sh
and it must accept 2 numbers as command line parameters $1
and $2
. It must print the product (multiplied value) of the numbers as output. But this time in a new format - The total price for items is 1000 dollars
my answer is :
bob@caleston-lp10:~$ cat /home/bob/calculation.sh
price=$(( $1 * $2 ))
echo “The total price for items is ${price} dollars”
bob@caleston-lp10:~$ bash /home/bob/calculation.sh 4 5
The total price for items is 20 dollars
bob@caleston-lp10:~$ bash /home/bob/calculation.sh 10 100
The total price for items is 1000 dollars
Please anyone explain about this question and solution