set vi as default cronjob editor

From WebHostingNeeds.com
Jump to: navigation, search

set vi as default editor in cpanel server


Method 1

vi /etc/bashrc

Find

export EDITOR="pico"
export VISUAL="pico"

Replace with

export EDITOR="vi"
export VISUAL="vi"


Method 2

edit .bash_profile

vi /root/.bash_profile

Add

export VISUAL=vi

Once added, .bash_profile will look like

[email protected] [~]# cat .bash_profile
# .bash_profile

# Get the aliases and functions
if [ -f ~/.bashrc ]; then
        . ~/.bashrc
fi

# User specific environment and startup programs

PATH=$PATH:$HOME/bin

export VISUAL=vi
export PATH
unset USERNAME
uptime
[email protected] [~]#

Method 3

If you need it done one time only, run following commands on command prompt.

VISUAL=vi; export VISUAL



vim

export