Find the answer to your Linux question:
Results 1 to 2 of 2
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    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:
    * * * * * (/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

  2. #2
    OK, OK, should have been more diligent at reading the man page.

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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts