Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Running a script from cron results error

Status
Not open for further replies.

konthag

IS-IT--Management
Mar 7, 2003
3
HU
I get the following mail after running a script.

From daemon Fri Mar 7 11:26:01 2003
Date: Fri, 7 Mar 2003 11:26:01 +0100
From: daemon
To: mfgbatch

stty: tcgetattr: A specified file does not support the ioctl system call.


*****************************************************************
cron: The previous message is the standard output
and standard error of one of the cron commands.
 
It seems as though the script is using the
Code:
stty
command to check or alter terminal characteristics. Since the script is running from cron, there is not a real or pseudo-terminal associated with it, only
Code:
stdin
,
Code:
stdout
, and
Code:
stderr
filehandles, which cannot be altered in the same ways as terminals. You can modify the script to not use stty when it is not a terminal by using the
Code:
tty
command to check whether it is running on a tty or not, i.e.:
Code:
if tty -s; 
  then
    stty ...
  fi
The -s option tells the
Code:
tty
program to suppress output.
 
I thought I found the problem by remarking this row:
#stty intr '^c'

,but this ain't solve my problem. Actually no mail came to me like the one before.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top