in reply to Re^2: set environment for parent process
in thread set environment for parent process

You said:

The problem is that the shell script runs 2 scripts to set up the required environment.

tilly's snippet does just that - it runs some script and extracts the environment that script sets up. This approach is the only approach under unixish shells by which you can get at whatever environment a script sets up when being sourced. Even though your script is not being run by cron, I think your problem is the same and is solved by tilly's approach.