On Wed, 7 Apr 1999, Gerard O'Donnell wrote:
>It's an expect script,
>which if run by hand goes fine, but flops when run by cron.
>when run by cron dies with
>this error:
>
>failed to get controlling terminal using TIOSCTTYparent: sync byte write:
>broken pipe.
Try adding the -nottycopy option to your spawn command. Normally spawn
initializes the pty by first copying the settings from the tty. Since a cron
job runs as a background process, there is no tty. This option will suppress
that step.
Although the following would not be the cause of your current problem, I'll
mention it anyway because it may be the cause of an eventual problem which you
might hit after resolving this one. Cron typically does not set the SHELL and
HOME environment variables. Expect scripts may not run correctly if either of
these variables is not set. It may be prudent, therefore, to add the following
two lines to the beginning of your script:
set env(SHELL) /bin/sh
set env(HOME) [pwd]
--
Dave Mielke | 856 Grenon Avenue | I believe that the Bible is the
Phone: 1-613-726-0014 | Ottawa, Ontario | Word of God. Please contact me
EMail: [EMAIL PROTECTED] | Canada K2B 6G3 | if you're concerned about Hell.