BUT is it possible to make the following to work ?
FUN_ECHO "hi how are you ?"
FUN_ECHO(){
echo $1
}
I know that the code will be executed line by line. But i have a number of functions.. which may call another function and may return to some other... and so and so...
is there any way to call as in Java...?? [ i mean from anywhere in the same page/script]
Define all your functions at the beginning of the script. Then they may be called from wherever you like, in any order, including from another function.
You could also collect your functions in a separate file, and use them in other scripts as well. Include them in your script like this:
. func_library.sh
The dot command runs the func_library.sh script in the same shell, thus making the functions available to it. Less clutter and one place to maintain commonly used functions.