Unix Technical Forum

Setting the EDITOR environment variable for root

This is a discussion on Setting the EDITOR environment variable for root within the Sun Solaris Administration forums, part of the Solaris Operating System category; --> I am using Solaris 9 and am trying to set the EDITOR environment variable for the root user (and ...


Go Back   Unix Technical Forum > Unix Operating Systems > Solaris Operating System > Sun Solaris Administration

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 01-16-2008, 10:42 AM
mutts
 
Posts: n/a
Default Setting the EDITOR environment variable for root

I am using Solaris 9 and am trying to set the EDITOR environment
variable for the root user (and for everyone else for that matter) so
that I can edit crontab files. Soalris defults to the horrible ed
editor (why?) and I would prefer to use vi.

I've seen people say to edit the /etc/profile file but I don't know
excatly what to add to make it work, and since this is a production
machine that we host for a College, I don't want to go off half-cocked
and break something.

Any help is appreciated.

Thanks

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 01-16-2008, 10:42 AM
Germen
 
Posts: n/a
Default Re: Setting the EDITOR environment variable for root

Hi Mutts, to set root profile you need edit /.profile this is the root
profile... /etc/profile it's a common profile for all users.

try add this at end in /.profile

# vi /.profile
....
....
EDITOR=vi
export EDITOR
TERM=vt100
export TERM

if you use bash

export EDITOR=vi
export TERM=vt100

and then exit and relogin again...

SalU2,

Mariano


mutts ha escrito:

> I am using Solaris 9 and am trying to set the EDITOR environment
> variable for the root user (and for everyone else for that matter) so
> that I can edit crontab files. Soalris defults to the horrible ed
> editor (why?) and I would prefer to use vi.
>
> I've seen people say to edit the /etc/profile file but I don't know
> excatly what to add to make it work, and since this is a production
> machine that we host for a College, I don't want to go off half-cocked
> and break something.
>
> Any help is appreciated.
>
> Thanks


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 01-16-2008, 10:42 AM
mutts
 
Posts: n/a
Default Re: Setting the EDITOR environment variable for root

Thats what I needed, thanks a lot
Germen wrote:
> Hi Mutts, to set root profile you need edit /.profile this is the root
> profile... /etc/profile it's a common profile for all users.
>
> try add this at end in /.profile
>
> # vi /.profile
> ...
> ...
> EDITOR=vi
> export EDITOR
> TERM=vt100
> export TERM
>
> if you use bash
>
> export EDITOR=vi
> export TERM=vt100
>
> and then exit and relogin again...
>
> SalU2,
>
> Mariano
>
>
> mutts ha escrito:
>
> > I am using Solaris 9 and am trying to set the EDITOR environment
> > variable for the root user (and for everyone else for that matter) so
> > that I can edit crontab files. Soalris defults to the horrible ed
> > editor (why?) and I would prefer to use vi.
> >
> > I've seen people say to edit the /etc/profile file but I don't know
> > excatly what to add to make it work, and since this is a production
> > machine that we host for a College, I don't want to go off half-cocked
> > and break something.
> >
> > Any help is appreciated.
> >
> > Thanks


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 01-16-2008, 10:42 AM
Claus Dragon
 
Posts: n/a
Default Re: Setting the EDITOR environment variable for root

Words to the wise, "Germen" <mariano.obarrio@gmail.com> wrote:


>and then exit and relogin again...


doesnt "source .profile" work in this case?
--
Claus Dragon <clauskick@mpsahotmail.com>
=(UDIC)=
d++ e++ T--
K1!2!3!456!7!S a27
"Coffee is a mocker. So, I am going to mock."

- Me, lately.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 01-16-2008, 10:42 AM
Germen
 
Posts: n/a
Default Re: Setting the EDITOR environment variable for root

Hi Claus,

the .profile is only read after login...but if you need use the
changes in that moment execute ". /.profile" for root profile.

Mariano

Claus Dragon ha escrito:

> Words to the wise, "Germen" <mariano.obarrio@gmail.com> wrote:
>
>
> >and then exit and relogin again...

>
> doesnt "source .profile" work in this case?
> --
> Claus Dragon <clauskick@mpsahotmail.com>
> =(UDIC)=
> d++ e++ T--
> K1!2!3!456!7!S a27
> "Coffee is a mocker. So, I am going to mock."
>
> - Me, lately.


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 01-16-2008, 10:42 AM
slackware guy
 
Posts: n/a
Default Re: Setting the EDITOR environment variable for root


Germen wrote:
> Hi Claus,
>
> the .profile is only read after login...but if you need use the
> changes in that moment execute ". /.profile" for root profile.
>
> Mariano
>
> Claus Dragon ha escrito:
>
> > Words to the wise, "Germen" <mariano.obarrio@gmail.com> wrote:
> >
> >
> > >and then exit and relogin again...

> >
> > doesnt "source .profile" work in this case?
> > --
> > Claus Dragon <clauskick@mpsahotmail.com>
> > =(UDIC)=
> > d++ e++ T--
> > K1!2!3!456!7!S a27
> > "Coffee is a mocker. So, I am going to mock."
> >
> > - Me, lately.


"source" is only used in csh ( maybe tcsh as well but I don't know )

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 01-16-2008, 10:42 AM
Dave Uhring
 
Posts: n/a
Default Re: Setting the EDITOR environment variable for root

On Tue, 08 Aug 2006 14:15:44 -0700, slackware guy wrote:

> "source" is only used in csh ( maybe tcsh as well but I don't know )


Wrong.

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8 (permalink)  
Old 01-16-2008, 10:42 AM
slackware guy
 
Posts: n/a
Default Re: Setting the EDITOR environment variable for root


Dave Uhring wrote:
> On Tue, 08 Aug 2006 14:15:44 -0700, slackware guy wrote:
>
> > "source" is only used in csh ( maybe tcsh as well but I don't know )

>
> Wrong.


Elaborate

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #9 (permalink)  
Old 01-16-2008, 10:42 AM
Dave Uhring
 
Posts: n/a
Default Re: Setting the EDITOR environment variable for root

On Wed, 09 Aug 2006 06:21:58 -0700, slackware guy wrote:

>
> Dave Uhring wrote:
>> On Tue, 08 Aug 2006 14:15:44 -0700, slackware guy wrote:
>>
>> > "source" is only used in csh ( maybe tcsh as well but I don't know )

>>
>> Wrong.

>
> Elaborate


man bash

source filename [arguments]

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #10 (permalink)  
Old 01-16-2008, 10:42 AM
slackware guy
 
Posts: n/a
Default Re: Setting the EDITOR environment variable for root


Dave Uhring wrote:
> On Wed, 09 Aug 2006 06:21:58 -0700, slackware guy wrote:
>
> >
> > Dave Uhring wrote:
> >> On Tue, 08 Aug 2006 14:15:44 -0700, slackware guy wrote:
> >>
> >> > "source" is only used in csh ( maybe tcsh as well but I don't know )
> >>
> >> Wrong.

> >
> > Elaborate

>
> man bash
>
> source filename [arguments]


So this means the source manpage is incomplete because it does not
mention bash or tcsh.
How are these pages updated?

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 05:12 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
www.UnixAdminTalk.com