Click to See Complete Forum and Search --> : crontab & echo & print


kowalsky
07-10-2001, 07:14 PM
Hi all,
how do I print something at the shell where I'm currently logged from within a cron job?
I noticed that any echo or any other print in the program triggered by cron will be printed in some file sent to /var/spool/mail.
What if I need to get that message right in front of me in the current shell?
thanks,
kowalsky

The Kooman
07-12-2001, 01:10 AM
AFAIK, a deamon process (the cron deamon in this case) should not read from or write to the standard input or output. So any output from cron will not go to the standard output (as you want it to).

However, I think there is a workaround! Its ugly, but its the only thing I can think of!

Find the tty which you want the output on. If you want it on the current terminal, then just type "tty" to get the tty device corresponding to the current terminal. Lets assume the output of the "tty" command is "/dev/pts/3".
Send your output to this tty. e.g. echo "Testing tty output" > /dev/pts/3


That should do it!! Hope this helps!