Comments on: How to Set and Unset Local, User and System Wide Environment Variables in Linux https://www.tecmint.com/set-unset-environment-variables-in-linux/ Tecmint - Linux Howtos, Tutorials, Guides, News, Tips and Tricks. Thu, 13 Jul 2023 14:45:18 +0000 hourly 1 By: abetancort https://www.tecmint.com/set-unset-environment-variables-in-linux/comment-page-1/#comment-1307114 Tue, 17 Dec 2019 04:42:44 +0000 http://www.tecmint.com/?p=18368#comment-1307114 Thanks, Felipe for your clarification, it was wondering why for the individual user there wasn’t an “environment” file to set variables for both the remote and console users like there are for system-wide variables. Now I know why it’s unnecessary.

Thanks

]]>
By: Adrian https://www.tecmint.com/set-unset-environment-variables-in-linux/comment-page-1/#comment-1306870 Mon, 16 Dec 2019 18:14:28 +0000 http://www.tecmint.com/?p=18368#comment-1306870 I installed a new version of the software with the same name as the previous version, and so I wanted to remove the environment variable associated with the old version in order to use the same variable linking the new version.

The problem I had is that I didn’t find where it was allocated, and didn’t find it in any of the files listed above. Finally, I encountered it in /etc/alternatives (I don’t understand why it was there).

Anyway, a useful tool to find an environment variable (e.g. var_name) is to open the terminal and type:

# grep -R var_name /etc/ (if you think it is in /etc/) or 
# grep -R var_name /home/ (if you think it is in /home/)
]]>
By: Felipe https://www.tecmint.com/set-unset-environment-variables-in-linux/comment-page-1/#comment-1305220 Thu, 12 Dec 2019 19:12:48 +0000 http://www.tecmint.com/?p=18368#comment-1305220 Learn How to Create, User-Wide and System-Wide Environment Variables in Linux / 1.b Set and Unset Local Variables in Linux.

This is wrong! Using export makes the variable an environment variable. Just setting it to empty does not clear the env var it still exists with an empty value and any checks for its existence would return true.

You need to use unset to remove the variable in this case.

$ export VAR1=1
$ env | grep VAR1
VAR1=1
$ VAR1=''
$ env | grep VAR1
VAR1=
$ unset VAR1
$ env | grep VAR1
]]>
By: Azad https://www.tecmint.com/set-unset-environment-variables-in-linux/comment-page-1/#comment-1103361 Wed, 20 Feb 2019 14:19:17 +0000 http://www.tecmint.com/?p=18368#comment-1103361 Is there any api to get list of only user defined environment-variables ?

]]>
By: Ritesh Vishwakarma https://www.tecmint.com/set-unset-environment-variables-in-linux/comment-page-1/#comment-1079422 Wed, 05 Dec 2018 06:48:37 +0000 http://www.tecmint.com/?p=18368#comment-1079422 As mentioned “.bashrc” – This file is user specific file that gets loaded each time user creates a new local session” But, it works from remote session as well.

]]>