The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

how to change the default editor for crontab

Discussion in 'General Discussion' started by colet, Jun 15, 2006.

  1. colet

    colet Member

    Joined:
    Apr 26, 2006
    Messages:
    22
    Likes Received:
    0
    Trophy Points:
    1
    Hello,

    When I run crontab -e I get pico not found. I'd actually like to use vim. My shell is bash, so I added EDITOR=vim; export EDITOR to ~/.bashrc. Now when I login, $EDITOR contains vim, but crontab is still looking for pico.

    Any idea what I've missed?

    Thanks for any help.

    --
    Cole
     
  2. thehostinghut

    thehostinghut Well-Known Member

    Joined:
    Jan 5, 2005
    Messages:
    232
    Likes Received:
    0
    Trophy Points:
    16
    I think the editor that you have is nano

    You can fix this buy doing this:

    cd /usr/bin
    ln -s nano pico
     
  3. colet

    colet Member

    Joined:
    Apr 26, 2006
    Messages:
    22
    Likes Received:
    0
    Trophy Points:
    1
    Hi,

    Thanks for the tip. Would the same technique allow me to use vim instead of pico?

    --
    Cole
     
  4. colet

    colet Member

    Joined:
    Apr 26, 2006
    Messages:
    22
    Likes Received:
    0
    Trophy Points:
    1
    solved

    Hello,

    Appearently crontab uses $VISUAL environment variable. So I added the following to my ~/.bashrc:
    export EDITOR="vim"
    export VISUAL="vim"

    Thanks for the feed back.

    --
    Cole
     
Loading...

Share This Page