maybe hook into PS1 re-rendering, problem: how to call export in string assignment to variable without forking, $() forks, PS1=$(function_that_renders_and_also_export) would be easy... doesn't help here
use command substitution $() (still a fork), but manipulate parent shell via gdb... weird sh*t
better ideas
$ cat rc
PROMPT_COMMAND="export DDD=\$(date)"
$ bash --rcfile rc
$ env | grep -i ddd
DDD=Mi 24. Mai 22:45:05 CEST 2017
$ env | grep -i ddd
DDD=Mi 24. Mai 22:45:07 CEST 2017
$ env | grep -i ddd
DDD=Mi 24. Mai 22:45:07 CEST 2017
$ env | grep -i ddd
DDD=Mi 24. Mai 22:45:08 CEST 2017
make actual PROMPT_COMMAND to be conditional on token expiry and perform everything necessary to update the environment, should be possible, see
vague ideas
$()
forks,PS1=$(function_that_renders_and_also_export)
would be easy... doesn't help here$()
(still a fork), but manipulate parent shell via gdb... weird sh*tbetter ideas
PROMPT_COMMAND
to be conditional on token expiry and perform everything necessary to update the environment, should be possible, see