source some_file
some_file:
doit ()
{
echo doit $1
}
export TEST=true
If I source some_file the function "doit" and the variable TEST are available on the command line. But running this script:
script.sh:
#/bin/sh
echo $TEST
doit test2
Will return the value of TEST, but will generate an error about the unknown function "doit".
Can I "export" the function, too, or do I have to source some_file in script.sh to use the function there?