Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
EDITOR in /etc/rc.conf - why?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
panserg
Apprentice
Apprentice


Joined: 16 Apr 2003
Posts: 188

PostPosted: Tue Jun 24, 2003 1:38 pm    Post subject: EDITOR in /etc/rc.conf - why? Reply with quote

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
View user's profile Send private message
haceye
Apprentice
Apprentice


Joined: 22 May 2003
Posts: 187
Location: Stuttgart, Germany

PostPosted: Tue Jun 24, 2003 1:52 pm    Post subject: Reply with quote

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
View user's profile Send private message
AlterEgo
Veteran
Veteran


Joined: 25 Apr 2002
Posts: 1619

PostPosted: Tue Jun 24, 2003 1:57 pm    Post subject: Reply with quote

If you use sudo, the command visudo will call the editor specified in /etc/rc.conf by using "EDITOR=" (IIRC)
Back to top
View user's profile Send private message
Naan Yaar
Bodhisattva
Bodhisattva


Joined: 27 Jun 2002
Posts: 1549

PostPosted: Tue Jun 24, 2003 2:01 pm    Post subject: Reply with quote

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
View user's profile Send private message
Genone
Retired Dev
Retired Dev


Joined: 14 Mar 2003
Posts: 9523
Location: beyond the rim

PostPosted: Wed Jun 25, 2003 1:15 am    Post subject: Reply with quote

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
View user's profile Send private message
mona-
n00b
n00b


Joined: 18 Dec 2002
Posts: 40

PostPosted: Wed Jun 25, 2003 3:36 pm    Post subject: Reply with quote

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. :wink:
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum