Expr in Shell
Hi there,
I am creating a shell program. I am using expr but the output is not the one that is expected. This is the code i am trying is #!/bin/bash echo "adding two numbers" echo "Enter First Number" read a echo "Enter second Number" read b echo "The sum of $a and $b is 'expr $a + $b'" but instead of giving me the total of two numbers, its giving me the output as "The sum of 2 and 3 is 'expr 2 + 3'". Please help. |
You need to use backticks (`), not single quotes (').
|
All times are GMT -5. The time now is 10:34 AM. |