I would like to pass an argument to a function and return a calculated value from it to be stored for further process. Below is the sample code.
#!/bin/bash
test()
{
echo $1
c=$(expr $1 + "10000")
return $c
}
var=$(test 10)
echo $var
I would like to get the value of c stored in var. Can anyone please help in this case.