There are two ways that I know this. The first is to run the script in the context of the current shell with any of:
. myscript.sh
source myscript.sh
but it risks polluting the current shell with all sorts of things.
I would prefer a solution in which the amount of information leakage is minimal. This means that it still works as a subshell, but outputs a new path to the output of statndard:
PATH=$(myscript.sh)
This method is much better, since the path is the only thing that the subshell can affect, but you must be careful what this subshell produces.