expr doesn't handle decimals/floating numbers and your assignment syntax is wrong. Use var=value without the spaces. This fixes everything but expr . I don't know your project requirements but you will need to find another way to handle the math. Bash can handle math on its own by the way:
#!/bin/bash
a=0
myfunc(){
echo "Computation"
#a=`expr 3.14\* ${2}\*${2}|bc`
a=`echo 5`
echo ${a}
}
myfunc ${1} ${2}
sknake
Industrious Poster
4,954 posts since Feb 2009
Reputation Points: 1,764
Solved Threads: 735