proper place to set environment variables?

Ralf Mardorf ralf.mardorf at alice-dsl.net
Mon May 12 21:01:40 CEST 2014


On Mon, 2014-05-12 at 11:27 -0700, MR ZenWiz wrote:
> E.g., I use bash, so my ~/.bashrc file contains what I want set and it
> also sources other files so I can keep things like my aliases and
> functions under separate controls.

Yesno :D.

[root at archlinux rocketmouse]# cat /root/.bashrc
cat: /root/.bashrc: No such file or directory
[root at archlinux rocketmouse]# cat /home/rocketmouse/.bashrc
#
# ~/.bashrc
#

# If not running interactively, don't do anything
[[ $- != *i* ]] && return

alias ls='ls --color=auto'
PS1='[\u@\h \W]\$ '

export EDITOR="nano"
[root at archlinux rocketmouse]#

If I run visudo this way:

[rocketmouse at archlinux ~]$ sudo -i
[root at archlinux ~]# visudo

or this way

[rocketmouse at archlinux ~]$ sudo visudo

the editor _is not_ nano.

Assumed I run visudo this way:

[rocketmouse at archlinux ~]$ su
[root at archlinux rocketmouse]# visudo

or this way

[rocketmouse at archlinux ~]$ su -c visudo

the used editor is nano.

[rocketmouse at archlinux ~]$ echo $USER $(id -u)
rocketmouse 1000

[rocketmouse at archlinux ~]$ sudo -i
[root at archlinux ~]# echo $USER $(id -u)
root 0

[rocketmouse at archlinux ~]$ su
[root at archlinux rocketmouse]# echo $USER $(id -u)
rocketmouse 0



More information about the Xfce mailing list