Re: how to use crontab and cron.daily

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



nigel henry wrote:
> 
> Ok. Just ran crontab -e, and again have got my newly created crontab, but 
> using vi, so presumably export EDITOR=nano was a one shot thing. I have the 
> vi cheat sheet, but I think you have to be using it all the time to get 
> really used to working with it, and probably the same goes for emacs. I don't 
> use text mode text editors much, and nano is for me the easier to use. I'll 
> edit ~/bash_profile and set nano as the editor to be used.
> 
When you use export <variable>=<value> it only has affect in the
current secession. If you us it in a terminal, it only affects that
terminal, and is gone when you close the terminal. If you do it at
the CLI, it only affects that login secession.

In this case, if you open a terminal, or log in to the command line,
and run "export EDITOR=nano", then anything that uses the EDITOR
variable to decide what editor to use will use nano. But if you use
"su -" to change users, or log in on another VC, it will not be
affective. The change is also lost when you log out, or close the
terminal. Setting EDITOR affects more then just "crontab -e".
Commands like vipw and vigr also use it. There are others, but those
are the two that come to mind.

Also, if you are using a terminal under X, you can also use X based
editors like Kedit in place of Nano. If you really wanted to get
fancy, you could write a script that uses the TERM variable to
decide what editor to launch. (Ether EDITOR points to the script, or
the script is run in .bash_profile to set EDITOR when the shell starts.

Mikkel
-- 

  Do not meddle in the affairs of dragons,
for thou art crunchy and taste good with Ketchup!


[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux