- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Editor for cronjob!
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-04-2002 05:55 PM
11-04-2002 05:55 PM
When I try to add an entry to the crontab, the default editor is ed. But when I first login with normal user, the default editor is vi, after I su to root, the default editor for crontab changed to ed. But for other SA, the did not happen to this. How can I change the default editor to vi?
# crontab -e
1959
^C
?
# ps -ef|grep crontab
root 5574 5146 0 09:51:06 pts/5 0:00 crontab -e
root 5576 5575 0 09:51:07 pts/5 0:00 sh -c ed /tmp/crontab0JMYv0
root 5575 5574 0 09:51:06 pts/5 0:00 crontab -e
root 5577 5576 0 09:51:07 pts/5 0:00 ed /tmp/crontab0JMYv0
root 5621 5615 0 09:51:44 pts/6 0:00 grep crontab
Thanks in advance!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-04-2002 06:20 PM
11-04-2002 06:20 PM
Re: Editor for cronjob!
export EDITOR=vi
crontab -e
To fix the problem permanently, set the EDITOR variable in your shell's startup script (.profile for Bourne/Kron/POSIX, .login for csh;note the syntax for setting EDITOR is different for csh).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-04-2002 06:26 PM
11-04-2002 06:26 PM
SolutionTo inquire:
# set -o
Current option settings
allexport off
bgnice on
emacs off
errexit off
gmacs off
ignoreeof off
interactive on
keyword off
markdirs off
monitor on
noexec off
noclobber off
noglob off
nolog off
nounset off
privileged off
restricted off
trackall off
verbose off
vi on
viraw off
xtrace off
# set -o vi (to turn it on)
One other thing. New ver us 'crontab -e' to make changes to 'crontabs'.
Always use:
# crontab -l >/tmp/wrk (work file)
make your changes, save the file.
# crontab /tmp/wrk
If something goes wrong with your session, you have a better chance of saving your crontab file from becoming corrupted.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-04-2002 06:39 PM
11-04-2002 06:39 PM
Re: Editor for cronjob!
When I su to root from normal user usr001 with the following command:
$su
passwd:xxxxxxx
and the default editor is vi. This is correctly what I want.
but when I su to root with the command:
$su -
passwd:xxxxxxx
and the prompt for #echo $EDITOR
is blank. And the default editor for crontab is ed.
So the question can be swithed to:
What's the difference between
su and su -?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-04-2002 06:51 PM
11-04-2002 06:51 PM
Re: Editor for cronjob!
su - (picks up the environment set for root, basically uses root's .profile.)
su (just makes you root, but does not include root's environment.)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-04-2002 07:27 PM
11-04-2002 07:27 PM
Re: Editor for cronjob!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-04-2002 08:11 PM
11-04-2002 08:11 PM
Re: Editor for cronjob!
I still can not change that.
After I add the line
export $EDITOR=vi
input root .profile and I su to root.It prompt:
hosta:/home/usr001 >> su -
Password:
##########################################################################
You have new mail.
-sh: syntax error: `PLATFORM=$' unexpected
-sh: =vi: is not an identifier
How to get it on the right way!
Thanks a lot!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-04-2002 08:16 PM
11-04-2002 08:16 PM
Re: Editor for cronjob!
# Set up the shell variables:
PATH=$PATH:/usr/bin:/sbin
EDITOR=vi
export PATH EDITOR