I have a node program called xapp
that runs in console. I would like xapp
create a environment variable that stay alive until user close the terminal (not only while the program is running).
I tried this so far:
let key = 'bacon';
let MYVAR = 'AWESOME_VAR';
shell.exec(`export ${MYVAR}=${key}`);
shell.exec(`echo \$${MYVAR}`);
This doesn't print anything in console.
but even if 'bacon' is showed, what I really want is that the environment var stay alive after xapp
finish... So I could execute this in terminal:
echo $AWESOME_VAR
and see him showing 'bacon'.
What I'm trying to do is to get xpat
to communicate through multiple executions, but only while the same terminal session is active.
I tried something using process.env
without success, since the environment variables is valid only in the same process.