LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 01-09-2007, 01:06 PM   #1
subnet_rx
Member
 
Registered: Oct 2001
Distribution: Ubuntu 9.10
Posts: 148

Rep: Reputation: 15
Editing at the command line


I have a couple of simple questions that I can't seem to figure out. I usually work on the desktop, but I'm working on a server through the terminal now so it's kind of new to me. First, when I type crontab -e (to edit the crontab file), what editor am I getting? I'm having trouble finding my around in it. Second, to execute a php file in this cron job, would I use /usr/bin/php path_to_file?
 
Old 01-09-2007, 01:11 PM   #2
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983
Regarding the first question, normally crontab -e uses /bin/vi, but eventually you have to specify the editor by setting the environment variable EDITOR, e.g.

Code:
export EDITOR=/bin/vi in bash/sh
setenv EDITOR /bin/vi in tcsh/csh
For the second issue, I have no idea... never used php, sorry.

Last edited by colucix; 01-09-2007 at 01:12 PM.
 
Old 01-09-2007, 01:12 PM   #3
anomie
Senior Member
 
Registered: Nov 2004
Location: Texas
Distribution: RHEL, Scientific Linux, Debian, Fedora
Posts: 3,935
Blog Entries: 5

Rep: Reputation: Disabled
The default editor for crontab in every Linux distro I've seen is vi. If you'd like to edit with nano, for example, you can use:
Code:
[hector@troy ~]$ export EDITOR=nano
[hector@troy ~]$ crontab -e
As for the second question, your cronjob should either build the PATH you need or use absolute paths to programs. So, presuming that's the location of the php program, your idea is probably correct.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Command Line Image Editing fractal_chaos Linux - Software 8 10-03-2005 05:33 PM
vi style command line editing in gnuplot 3.7 sirclif Linux - Software 0 09-20-2004 12:47 PM
editing XF86Config from command line flum Linux - Newbie 4 09-10-2003 04:12 PM
command line editing eddcrossman Linux - Newbie 7 02-16-2003 07:37 PM
Editing files at command line Goatdemon Linux - Newbie 15 08-12-2002 11:56 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 01:44 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration