Contrab question.

Contrab question.

Post by E W Rodrigue » Wed, 06 Dec 1995 04:00:00




> Ok, you've got me, I'm not a real man... Why, because I don't want to use
> vi to edit my cron jobs with the crontab -e option.  The man page
> (Dillion's crontab) says that I should set my VISUAL enviroment
> variable.  The problem I have is that (using both bourne and C-shells)
> every thing I try just results in crontab -e using vi.

> Any help would be greatly appreciated.

setenv EDITOR 'your-preferred-editor'

crontob -e should bring up your EDITOR.

Hope this helps.

Wil

---
    ______
___/   __ \______    ___________________________________________________
        _\_\_____)  /                                                  /
       (____)      /   New email address, same great person!  ;^)     /
__    (_____)     /                                                  /
  \____(___)      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

 
 
 

Contrab question.

Post by BOFH » Thu, 07 Dec 1995 04:00:00


Ok, you've got me, I'm not a real man... Why, because I don't want to use
vi to edit my cron jobs with the crontab -e option.  The man page
(Dillion's crontab) says that I should set my VISUAL enviroment
variable.  The problem I have is that (using both bourne and C-shells)
every thing I try just results in crontab -e using vi.

Any help would be greatly appreciated.

                                                                BOFH

 
 
 

Contrab question.

Post by d.. » Fri, 08 Dec 1995 04:00:00



: setenv EDITOR 'your-preferred-editor'

: crontob -e should bring up your EDITOR.

Tried this on my system (Slackware 2.3, essentially) just now.

export EDITOR='emacs'
($EDITOR brings up emacs, as it should)

but crontab -e still brings up vi.

: ---
:     ______
: ___/   __ \______    ___________________________________________________
:         _\_\_____)  /                                                  /
:        (____)      /   New email address, same great person!  ;^)     /
: __    (_____)     /                                                  /
:   \____(___)      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

--
------------------------------------------------------------------------
David E. Fox                 Tax              Thanks for lettimg me


-----------------------------------------------------------------------

 
 
 

Contrab question.

Post by Michele Marzia » Fri, 15 Dec 1995 04:00:00




> : setenv EDITOR 'your-preferred-editor'

> : crontob -e should bring up your EDITOR.

> Tried this on my system (Slackware 2.3, essentially) just now.

> export EDITOR='emacs'
> ($EDITOR brings up emacs, as it should)

> but crontab -e still brings up vi.

I've had exactly the same problem about three months ago. At the time
nobody seemed able to solve it (I had posted to a couple c.o.l.*
newsgroups). Then I decided to solve it myself. Here is what I posted to
comp.os.linux.misc. It includes the solution you're looking for.

## --------------------- SNIP SNIP SNIP SNIP------------------------------


Newsgroups: alt.uu.comp.os.linux.questions,comp.os.linux.misc
Subject: SOLVED: Crontab editor different from vi
Date: Mon, 04 Sep 1995 18:57:31 +0200
Organization: Dept. of Physics, Ferrara University, ITALY

MIME-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit

Lines: 32
X-Status: U

Last week I asked for help since I was unable to use a feature
documented in the man page for crontab, i.e. the use of the VISUAL
environment variable.

Even if I had a line saying 'export VISUAL=/usr/bin/joe' in my .profile,
vi popped up every time I launched 'crontab -e'.

Well, it seems that Slackware (at least 2.20 and 2.30) are using Matthew
Dillon's dcron 2.2. I gave a look at the source code for crontab.

IMHO, there is a minor bug in crontab.c which prevents the proper use of
the VISUAL environment variable. It's located in the EditFile function.
I must admit that I don't fully understand why there is a check of the
length of the VISUAL string (maybe, to avoid overflowing the 1024 local
buffer for sprintf?... or something else?).

Anyway, IMHO again, the second test should be reversed:

*** crontab.c.orig      Mon May  2 17:28:00 1994
--- crontab.c   Thu Aug 31 22:41:50 1995
***************
*** 310 ****
!       if ((ptr = getenv("VISUAL")) == NULL || strlen(ptr) < 256)
--- 310 ----
!       if ((ptr = getenv("VISUAL")) == NULL || strlen(ptr) > 256)

I recompiled crontab with the above fix and installed it.
It works as expected, as per the man page a.f.a. VISUAL is concerned.

I have been running it for a few days and it's fine for me.
I also emailed Mat Dillon about this problem but I didn't get any reply.

## --------------------- SNIP SNIP SNIP SNIP------------------------------

I never was able to get in touch with Matt Dillon, though. His e-mail

messages I sent him to report the bug bounced back.

Hope this helps.

--
Michele Marziani
Universita' di Ferrara     *     e-mail:


--
Michele Marziani
Universita' di Ferrara     *     e-mail: