Changing Default Editor in profile

Jerold McAllister jerrymc at msu.edu
Fri Sep 8 08:37:03 PDT 2006


Dominique Goncalves writes: 

> Hi, 
> 
> On 9/8/06, Huy Ton That <huyslogic at gmail.com> wrote:
>> under my home directory for root under .profile I added the line: 
>> 
>> EDITOR=pico;    export EDITOR 
>> 
>> where no such line existed for EDITOR before; this line exists in my
>> personal account that I use and my default for external launched editors 
>> is
>> now pico such that I can edit crontab stuff easily.  However, when I ssh 
>> in
>> and then su, I try to run crontab only to find it is still booting into 
>> 'vi'
>> by default.  Any ideas how I can get this loaded?
> 
> You have to use "su -", if you want load your root's environnement.
> su(1) for more explications. 
> 

That is the specific answer to your question, but here is an additional
caution. 

You do not want to have the main root account set up with anything
but the minimal stuff that will be available in single user mode with
only the / partition mounted just in case you have trouble and need it.
For it to be root it needs to have UID = 0 and best to have GID = 0.
It doesn't need to be named root. 

So, I would suggest making your own separate root account - maybe named
something like domr or domR or something else convenient and then give
that account all the nice things like your favorite shell and editor, etc
so you can use that as root when all the system is up and happy and leave
the main root with /bin/sh as shell and /usr/bin/vi as editor, etc.
I usually even put a copy of vi in /bin just for those occasions. 

Just a suggestion, 

////jerry 

> HTH
>> _______________________________________________
>> freebsd-questions at freebsd.org mailing list
>> http://lists.freebsd.org/mailman/listinfo/freebsd-questions
>> To unsubscribe, send any mail to 
>> "freebsd-questions-unsubscribe at freebsd.org" 
>> 
> 
> Regards. 
> 
> -- 
> There's this old saying: "Give a man a fish, feed him for a day. Teach
> a man to fish, feed him for life."
> _______________________________________________
> freebsd-questions at freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-questions
> To unsubscribe, send any mail to 
> "freebsd-questions-unsubscribe at freebsd.org" 
> 
 




More information about the freebsd-questions mailing list