Talk:Environment variables

From ArchWiki
Revision as of 12:56, 15 September 2012 by TheCycoONE (Talk | contribs) (profile.d question)

Jump to: navigation, search

I created this page due to the lack of info I could find on Environment Variables in the Arch wiki, except a few sentences in the Bash page. Hopefully this page may prompt some more knowledgeable people on the subject to review and edit as required to more accurately reflect an Arch Linux system. See https://wiki.archlinux.org/index.php?title=Talk:Bash&action=edit&section=1

visudo

I'm not sure if you want to include such details here, but the visudo manpage has an explanation why your EDITOR isn't the one used to edit when using visudo:

There is a hard-coded list of one or more editors that visudo will use set at compile-time that may be
overridden via the editor sudoers Default variable.  This list defaults to "/usr/bin/vi".  Normally, visudo
does not honor the VISUAL or EDITOR environment variables unless they contain an editor in the aforementioned
editors list.  However, if visudo is configured with the --with-env-editor option or the env_editor Default
variable is set in sudoers, visudo will use any the editor defines by VISUAL or EDITOR.  Note that this can
be a security hole since it allows the user to execute any program they wish simply by setting VISUAL or
EDITOR.

-- Karol 18:58, 30 May 2011 (EDT)

Thanks for the info Karol. I have my editor for manipulating the sudoers file set to Nano. To be honest, I don't really remember the details other than setting EDITOR to nano somewhere..... Would you please add the above info as you see appropriate, into the EV page? Also jump in and help out where ever else you'd like - jeff story
Our package is built with '--with-env-editor' so just setting your EDITOR is enough. You can add this info to your article if you want. -- Karol 15:10, 19 August 2011 (EDT)

/etc/profile.d

The article mentions putting your environment variables in /etc/profile. /etc/profile seems to source from the files in /etc/profile.d which seems like a less disruptive place to put your new variables, similar to the way modules-load.d works these days TheCycoONE (talk) 12:56, 15 September 2012 (UTC)