Sample Header Ad - 728x90

How to set environment variables at startup in Archlinux

5 votes
1 answer
26275 views
When I'm using the **svn** client in my bash I have to set first the variable **SVN_EDITOR** like this: export SVN_EDITOR=cat So I thought it'd be easier for my if I set the environment variable at startup. I'm using Archlinux, so I referred to the ArchWiki, but there I found out there are multiples ways to set variables . - Editing ~/.bashrc - Editing ~/.config/systemd.user.conf - Using systemctl --user set-environment - Editing ~/.profile - Editing ~/.pam_environment - Editing ~/.bash_profile - And even some more. I'm the only user, so I don't care if the variable is set globally or per user. Of all the ways to do it, what's the best? What's the "new standard"? I'm using an up-to-date Archlinux with Gnome and budgie desktop. Thank you very much. EDIT: As @jasonwryan said, the question is similar to https://unix.stackexchange.com/questions/21598/how-do-i-set-a-user-environment-variable-permanently-not-session But I'm also asking for what's the most "correct" way to do this, also I'm not sure if there's any new standard since that question (5 years ago). And for some things, Archlinux is quite special, not sure if there was any specific way to do this in it.
Asked by Argos (53 rep)
Mar 28, 2017, 08:08 AM
Last activity: Jan 26, 2021, 10:00 PM