Calling export MYVAR=/path/to/whatever
from .bashrc
obviously works for bash but not for the sh
shell. Unfortunately, the Matlab launcher seems hell-bent on using sh
and not bash
. As such, the simplest way to export an environment variable such that it is accessible from Matlab would be to export said variable to sh
.
How can I persistently export an environment variable to sh
?
/etc/environment
and.pam_environment
apply everywhere.