View previous topic :: View next topic |
Author |
Message |
panserg Apprentice
Joined: 16 Apr 2003 Posts: 188
|
Posted: Tue Jun 24, 2003 1:38 pm Post subject: EDITOR in /etc/rc.conf - why? |
|
|
I found that setting EDITOR in /etc/rc.conf is not enough to make usable:
Code: |
# grep "^EDITOR" /etc/rc.conf
EDITOR="/usr/bin/emacs -nw"
# echo $EDITOR
#
|
It means setting EDITOR in /etc/rc.conf is not used anywhere. The why si it set there?
And what is the best place in Gentoo to set system-wide editor? |
|
Back to top |
|
|
haceye Apprentice
Joined: 22 May 2003 Posts: 187 Location: Stuttgart, Germany
|
Posted: Tue Jun 24, 2003 1:52 pm Post subject: |
|
|
Hi,
don't know why you have a EDITOR=.. Setting in your rc.conf. I have not.
Anyway.. the prefered way to set the EDITOR-Env variable (and others) is in the /etc/env.d directory.
Especially for the EDITOR-Setting, you should use /etc/env.d/00basic.
David _________________ faster 'emerge -s'? emerge esearch |
|
Back to top |
|
|
AlterEgo Veteran
Joined: 25 Apr 2002 Posts: 1619
|
Posted: Tue Jun 24, 2003 1:57 pm Post subject: |
|
|
If you use sudo, the command visudo will call the editor specified in /etc/rc.conf by using "EDITOR=" (IIRC) |
|
Back to top |
|
|
Naan Yaar Bodhisattva
Joined: 27 Jun 2002 Posts: 1549
|
Posted: Tue Jun 24, 2003 2:01 pm Post subject: |
|
|
You can do:
Code: |
echo 'EDITOR="/usr/bin/emacs -nw"' > /etc/env.d/00myown
env-update
|
This will update /etc/profile.env, /etc/csh.env, etc., to reflect your editor preference the next time you log in. |
|
Back to top |
|
|
Genone Retired Dev
Joined: 14 Mar 2003 Posts: 9523 Location: beyond the rim
|
Posted: Wed Jun 25, 2003 1:15 am Post subject: |
|
|
The content of /etc/rc.conf seems to be pretty random, I think it should be abandoned altogether and the settings should be moved to other files (likely in /etc/conf.d) |
|
Back to top |
|
|
mona- n00b
Joined: 18 Dec 2002 Posts: 40
|
Posted: Wed Jun 25, 2003 3:36 pm Post subject: |
|
|
hi,panserg.
I have EDITOR setting in /etc/rc.conf, same as you.
At my machine, the EDITOR setting in /etc/rc.conf is effective.
The setting seems to be used by /etc/profile.
last few lines in my /etc/profile
Code: | # Extract the value of EDITOR
[ -z "$EDITOR" ] && EDITOR="`. /etc/rc.conf 2>/dev/null; echo $EDITOR`"
[ -z "$EDITOR" ] && EDITOR="`. /etc/conf.d/basic 2>/dev/null; echo $EDITOR`"
[ -z "$EDITOR" ] && EDITOR="/bin/nano"
export EDITOR |
If your /etc/profile is same above, it will work like this,
If EDITOR is empty yet, then use setting in /etc/rc.conf
If EDITOR is empty yet, then use setting in /etc/conf.d/basic
If EDITOR is empty yet, then use (default) "/bin/nano"
So I think that maybe because of your problem is to set EDITOR any other place.
Try "grep -r EDITOR /etc" and look for ~/.bashrc and ~/.bash_profile.
#Sorry for my broken english. |
|
Back to top |
|
|
|