How do I read or access the TRAVERSE
environment variable below?
nicholas@gondor:~$
nicholas@gondor:~$ printenv | grep PATH
WINDOWPATH=2
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
nicholas@gondor:~$
nicholas@gondor:~$ printenv | grep TRAVERSE
nicholas@gondor:~$
nicholas@gondor:~$ cat /etc/environment
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin"
TRAVERSE="/home/nicholas/some_directory"
nicholas@gondor:~$
I ran source ~/.bashrc
without result. I expect that if I were to reboot the variable would be readable, but that seems extreme.
see also:
/etc/environment
? – Gunnar Hjalmarsson Jul 21 '21 at 10:53source /etc/environment
which will update the current bash process with your latest changes. Well, new variables won't be exported to the environment that way, but only available as shell variables. – Gunnar Hjalmarsson Jul 21 '21 at 11:10/etc/environment
is read at login, by the login process, before shell or GUI is started, and only at that time. So relogin is a proper way to apply changes in this file. – raj Jul 21 '21 at 11:13/etc/environment
differs a lot from that of shell scripts, so while your particular file could be sourced, not all valid environment files can be. – muru Jul 21 '21 at 11:24~/.pam_environment
syntax. – Gunnar Hjalmarsson Jul 21 '21 at 13:52