i have a function written in one shell script and i want to call that function in another shell script and use the value returned by that script.
can any one suggest me how can i do that?
regards,
Rajesh.P
i have a function written in one shell script and i want to call that function in another shell script and use the value returned by that script.
can any one suggest me how can i do that?
regards,
Rajesh.P
my_functions.inc
----------------
#! /bin/sh
f_echo() {
echo "$1"
return 0
}
test.sh
-------
#! /bin/sh
. ./my_functions.inc
f_echo "Hello!"
chmod +x my_functions.inc test.sh
./test.sh
Hi
I am being a bit cheeky here asking a question but....
Robotronic,
does this methodology work for ksh as well and in the same way?
cheers
Yes it will work for KSH too and in the same way.
when i call the script using
. $<directoryname>/<scriptname>
it is exiting from the loop
what i have to do for the same