If, from csh, youre trying to reach session variables defined in a bash shell script, you must call the bash script prior to starting up the csh.
A session gets inherited into subprocesses, like so, where the csh.SESSION and csh.SESSION_INHERITED are merged once the csh 'boots':
bash/
├── csh
│ ├── SESSION
│ └── SESSION_INHERITED
└── SESSION
The bash.SESSION is NOT accessible from within csh shell as this would expose the init
runlevel to any subprocesses.. Its is a fork
, which during spawn duplicates the environment.
So, you can run from bash: source test.sh; csh
. This will expose the exports from test.sh to csh - but its a static export which cannot be modified programatically in the csh.
Haven't 100% understood your question since its very abstract.. But this hopefully helps :)