LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 01-21-2004, 02:38 PM   #1
marist89
LQ Newbie
 
Registered: Oct 2003
Distribution: RH 9 & 2.x AS
Posts: 28

Rep: Reputation: 15
Cron & ksh: Solaris/RHEL 2 incompatibility


I am trying to setup some cron jobs on my RHEL 2 box the same way I run them on Solaris 8. On Solaris, I have a crontab entry of:
Code:
* * * * * (/bin/ksh ". $HOME/.profile; env")
which correctly sources my .profile and mails me back the output from env after the .profile has been sourced.

However, in RHEL 2, I setup a crontab entry with the exact same syntax, and I get a message back from cron stating:
/bin/ksh: . /home/users/myuser/.profile; env: No such file or directory

The error means /bin/ksh is trying to execute a file named ". $HOME/.profile; env" which of course is not there. How do I get RHEL's ksh to execute multiple comands in a crontab?

miscellanea: This is just an example. I understand I can wrap "env" around another ksh script and source the .profile there, but there should be a way to do it within the crontab entry.
 
Old 01-21-2004, 03:48 PM   #2
marist89
LQ Newbie
 
Registered: Oct 2003
Distribution: RH 9 & 2.x AS
Posts: 28

Original Poster
Rep: Reputation: 15
OK, OK, should have been more diligent at reading the man page.

I want:
Code:
* * * * * (/bin/ksh -c ". $HOME/.profile; env")
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
RHEL vs aix and solaris msound Linux - General 14 11-23-2005 03:21 AM
cp in cron - solaris twantrd Solaris / OpenSolaris 4 07-30-2005 01:11 PM
ca brightstor arcserv 9 & rhel as 3 enmaca Linux - General 0 01-15-2004 10:38 PM
No mail in Solaris Cron commands markraem Solaris / OpenSolaris 1 01-05-2004 03:11 PM
How to use cron command in solaris meng_en General 1 11-06-2002 09:08 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 01:32 AM.

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