We help IT Professionals succeed at work.

SCO crontab / vi error?

tel2
tel2 asked
on
I'm using SCO, and I've just tried to edit the root crontab (my first time on this machine), by entering the following command (logged on as root), and I get the following error:

# crontab -e
crontab: could not exec the editor.: No such file or directory (error 2)
crontab: warning: commands will be executed using /bin/sh

As you can see, I can display the contents of root's crontab OK:
# crontab -l

#       @(#) root 25.3 95/01/17
...etc...
17 5 * * 0 /etc/cleanup > /dev/null
...etc...


And here's the crontab file:
# ls -l /var/opt/K/SCO/Unix/5.0.4Eb/usr/spool/cron/crontabs/root
-rw-rw----   1 root     cron         948 Oct 15 10:52 /var/opt/K/SCO/Unix/5.0.4E
b/usr/spool/cron/crontabs/root


Here's my SCO version:
# uname -a
SCO_SV ctol33 3.2 2 i386


Any ideas how to make it so I can properly update root's crontab?
Comment
Watch Question

CERTIFIED EXPERT

Commented:
Hi  tel2,

     You do the followings before editing the crontab:
      #EDITOR=vi
      #export EDITOR
      then use crontab -e command to edit your crontab. (you are
using vi editor in this case to edit the file)

      Cheers!

============
yuzh

     
Commented:
I usually create a new file to edit,then edit it with vi ,then use the crontab command on the file

crontab -l > newfile
vi newfile
crontab newfile
CERTIFIED EXPERT

Author

Commented:
Thanks vinnyd79, It worked!  (On AIX at least - haven't tried it on SCO yet, but I thought I shouldn't keep you waiting any longer).
You've given me a good workaround for the problem, so I'll give you a B, because I still don't know what's causing the error.  Got to leave room for improvement.
Thanks.

vuzh,
I have confirmed that EDITOR was already set to vi, and it was exported, so that wasn't the problem.

Explore More ContentExplore courses, solutions, and other research materials related to this topic.