On 30/12/2019 16:10, Andrey Butirsky wrote:
Didn't think about "exec bash", thanks. However, it's essentially a
restarting. So you loose the environment, e.g.
If by "environment" you mean the exported environment variables..
`exec' "retains" them, they will be accessible:
export EXPORTED=foo; non_exported=bar; exec bash -c 'echo "$EXPORTED
$non_exported"'
-> foo
(perhaps run the above after having run an additional copy of bash if
your terminal program, say gnome-terminal, closes the window when the
shell exits, as the exec'd bash will exit immediately after echo'ing).
Or, what you mean by "environment"?