Hot answers tagged

17

This is not a security risk at all, because you can always only set environment variables for your current environment (e.g. current Bash session) and, using the export command, its child environments (scripts you launch, subshells, etc.). It's impossible to escalate an environment variable created or modified into the parent environment. This includes that ...


12

C stands for the C programming language. It is a synonym for the POSIX locale. See http://pubs.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap07.html#tag_07_02 The POSIX locale can be specified by assigning to the appropriate environment variables the values "C" or "POSIX".


5

Well while I'm not really sure if this is what you want, you can get all the shell variables with the following commands: set -o posix set Or if you want it in an easily scrollable way you can pipe it through less like the following: ( set -o posix ; set ) | less This will provide, like @heemayl stated in his comment, all shell variables of which env ...


5

Possible methods: 1st try to log in using a TTY (control-alt-f1). If that does not work boot from a live DVD. and then use sudo nano /etc/environment from command line and edit out your mistake. Save and reboot to test what you did is correct. In case you need it: $ more /etc/environment PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/...


3

You need to log out of your user session and log back in again for changes made to /etc/environment to take effect. But you can make it work immediately by running this: source /etc/environment && export PATH I found that very useful command here on Stack Overflow


1

You must add the code in ~/.profile. Example: Make a copy of path variable before doing this procedure. In ~/.profile, there is a section like this: # set PATH so it includes user's private bin if it exists if [ -d "$HOME/bin" ] ; then PATH="$HOME/bin:$PATH" fi So, add at this at the end of the file: PATH="/usr/lib/jvm/java-8-oracle:/usr/lib/jvm/...


1

My speculations about the problem having to do with the PATH variable in fact turned out to be correct. I had added a new path in the file /etc/environment, but instead of adding it to the end of the already existing row with paths, I added it as a new line afterwards (as I wasn't sure how it should be done and just thought I'd give it a try). Apparently ...


1

While Vedeonauth's answer is completely valid for the current process, it sounds like you're asking for all of the installed applications. So to get the environment of all running applications do: sudo find /proc -name environ -maxdepth 2 | xargs cat | xargs --null --max-args=1 (Thanks to this answer for the part at the end which turns the null-delimited ...


1

Shell environment variables are used for several purposes, from storing data, storing software configurations, set terminal settings, and changing shell environment. The environment variables are normally set at boot time, or by different software as required. One way of setting environmental variables is from the command line. List all variables on ...



Only top voted, non community-wiki answers of a minimum length are eligible