set EDITOR=vi -> default editor not setting for cron tab

Hi All,

I am running a script , working very fine on cmd prompt. The problem is that when I open do crontab -e even after setting editor to vi by
set EDITOR=vi it does not open a vi editor , rather it do as below.....

/////////////////////////////////////////////////////
$ set EDITOR=vi
$ echo $EDITOR

$ crontab -e
79
29 16 * * * /bin/sh /app/siebel/testdir/automate.sh
?
The crontab file was not changed.
$

///////////////////////////////////////////////////////////

Even if i do ,

$vi crontab

it opens a vi editor for me with name crontab ,
where I can write the above line

29 16 * * * /bin/sh /app/siebel/testdir/automate.sh

and save . But it is not showing me the crontab job when I do

$crontab -l

Can some bdy help me for this ..

PS : I have also tried

$setenv EDITOR vi

but in vain, still getting no results. Really need your help for this.....

Thanks & Regards,
Aru

oops.............. even

$set EDITOR=vi
$export EDITOR

OR

$export EDITOR=vi

is also not working..... I feel sad. :frowning:

Help Plz......

Aru

Hi friends ,

I got the solution to my problem. i feel to discuss it in the form, so that others will be benifitted ...

At cmd prompt I just have to write two lines

EDITOR=vi;
export EDITOR

Now, crontab -e will open a vi editor for me. :slight_smile:

Chow.
Aru

I had the same problem, check and see if the VISUAL env. variable is set to something other than vi.

set | grep VISUAL

If so, then that's overriding the EDITOR variable.

Many ways to fix...

Add to your ~/.bash_profile (or /etc/profile, or /etc/profile.d/SOME_FILE)

export VISUAL=vi

I don't use bash

vi <=> vim :-??

please fo follwing change in .profile and save change:

    EDITOR=vi
    export EDITOR

=======================