LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Fedora (https://www.linuxquestions.org/questions/fedora-35/)
-   -   environment variable definition (https://www.linuxquestions.org/questions/fedora-35/environment-variable-definition-202070/)

skwattakamp 07-07-2004 03:54 AM

environment variable definition
 
I AM A NEWBIE AND I AM TRYING TO RUN USER-DEFINED CRONTABS ON FEDORA 2 FOR THE PURPOSE OF SYSTEM CLEANUPS. ONE THAT I AM TRYING TO RUN IS STORED UNDER /VAR/SPOOL/CRON. HOW DO I DEFINE AND EXPORT THE 'EDITOR' ENVIRONMENT VARIABLE SO I CAN EDIT MY SCHEDULES. I HAVE NOTICED THAT WITHIN etc/profile, THE 'EDITOR' VARIABLE IS NOT DEFINED. IF ANYONE HAS THE CODE FOR THAT I WOULD GREATLY APPRECIATE IT.

MrJoshua 07-07-2004 03:41 PM

If this is going to be an automated task I would recommend that you take advantage of cron.daily, cron.hourly etc.... You will also have to read that man pages for crontab, because it will require different things based on what you want to do. If you will let us know exactly what you need cron to do then I can help more.

slakmagik 07-07-2004 04:15 PM

MrJoshua - I think he was asking about how to specify an editor. It should default to a 'vi' but he can set it to anything, of course.

skwattakamp - You have two problems - 'tr [:upper:] [:lower:]' for an approximate solution to the first.

For the second, 'crontab -e' wants $VISUAL. So either

export EDITOR="your_editor"
(for general usage)
export VISUAL="your_editor"
(for crontab)

in .bashrc or .bash_profile should do (or /etc/profile, but that's system-wide).

skwattakamp 07-14-2004 02:45 AM

Thanks for your replies Digiot and MrJoshua. Digiot could you please explain the nature of the first issue, regarding conversion from upper to lower case. Where does that factor in? Again for me to export the editor, would i not have to extract it first? If anyone has code availabale that sets the EDITOR variable, I would greatly appreciate it. Digiot I am setting the editor specifically for executing crontab -e to edit user-defined schedules. The scripts are ratyher easy MrJoshua, just simple file removals. It's the configuration issues I am having problems with.

slakmagik 07-23-2004 11:17 PM

Sorry about disappearing.

The first was a bad joke about your caps-lock post.

As far as the rest, I guess you've gotten it straightened out by now. I hope so, because I'm confused. If you want to edit your crontab with a specific editor, you export the variable in your shell's init scripts. There's no 'code' beyond what I posted above and there's no 'extracting' unless you're trying to compile the editor and not just assign it to a variable.


All times are GMT -5. The time now is 04:05 AM.