Hi Guys,
I am unable to return a decimal value from a function to the main script.
I am getting the correct value in the function but when it is returning to the main script using "return" it is coming as 0. Below is my code.
read VALUE_V fun_FATHERID fun_SONID fun_TOPID fun_RTYPE < function_output.dat;
echo "outside=$VALUE_V";
echo "outside=$fun_FATHERID";
wc -l function_output.dat | read length dummy;
echo "length=$length";
if [ "$length" -eq "1" ] -a [ "fun_RTYPE" -eq "RW" ]
then
echo "value_v=$VALUE_V";
echo "chile_value=$child_value";
VALUE_V=$(echo "scale=4; $VALUE_V * $child_value" | bc);
echo "inside fucntion=$VALUE_V";
return $VALUE_V;
fi
Thanks for your help in advance.
Regards,
Magesh.
---------- Post updated at 08:22 PM ---------- Previous update was at 08:20 PM ----------
above is the code of the function. the main script just calls this function.