![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| return value of a function | fl0r10 | Shell Programming and Scripting | 5 | 07-06-2009 03:37 PM |
| need to return value from function | darshakraut | Shell Programming and Scripting | 5 | 05-14-2008 09:13 AM |
| Function call not return value into var | katzs500 | UNIX for Advanced & Expert Users | 4 | 04-21-2008 02:27 PM |
| decimal to binary function error | return_user | High Level Programming | 8 | 12-21-2007 03:53 PM |
| return value of a function | prez | Shell Programming and Scripting | 3 | 08-22-2007 06:08 PM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
unable to return a decimal value from a function
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. 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. |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|