I need make something like
$ source /etc/environments # called in bash.sh script
Of course after script finished no changes apply to shell. I know this is tricky if because child process cant modify parent 'bash' process. But May be another way to do so?
As you have observed yourself a child process cannot set persistent environment variables. One of the usual work around are writing something like this to stdout:
And then used in a command substitution:
An example of such script is
dircolors