The question title is a little confusing, I hope you can understand here.
I have a ksh script a.sh, in that I invoke wlst to execute a wlst script file b.py.
Can I export variables in b.py, then access these varibles in a.sh?
In other words, define a variable in wlst script, for the shell which started the wlst
May not be possible given that b.py is invoked via wlst.sh so any change to the environment variables done by b.py stays in that wlst.sh shell process.
I would suggest using java.util.Properties in b.py and push any name=value pair properties into a properties file (a.sh while invoking can tell b.py where the props file should be) and once b.py is done, a.sh can read that props file.
Also, please note that since b.py (that gets executed via wlst.sh) is the child shell of a.sh any variables that you export in a.sh can be accessed by b.py but not the other way round – Mani 12 hours ago