[SunHELP] stty: : No such device or address
DAUBIGNE Sebastien - BOR
sunhelp at sunhelp.org
Wed Dec 5 11:34:57 CST 2001
stty tries to access STDIN to configure/read the configuration
of the terminal via ioctl() calls.
As STDIN is not a terminal when launched via cron/at, the
ioctl() call returns ENXIO ("No succh device or address").
Note that it will not crash your job, it is just an information from stty.
Redirecting STDIN/STDOUT/STDERR to "/dev/null" will not help, as
"/dev/null" is not a terminal :-), so you'll get the same message.
Closing STDIN/STDOUT/STDERR via ">&-" or "<&-" operators will not
help much because you'll get another message (EBADF "Bad file number")
The only way to avoid such messages is to check you job and shell init
scripts (.profile, .kshrc) and precede each stty command with the following
:
tty -s && stty .....
instead of :
stty ....
The "tty" command will test if STDIN is a terminal before the shell launches
stty.
Here is an example :
# stty 0</dev/null
stty: : No such device or address
# ( tty -s && stty ) 0</dev/null
#
---
Sebastien DAUBIGNE
sebastien.daubigne at sema.fr <mailto:sebastien.daubigne at sema.fr> - (+33)
(0)5.57.26.56.36
Sema Global Services - AFM/DW/Pessac
-----Message d'origine-----
De: Edward Chase [SMTP:echase at postoffice.providence.edu]
Date: mercredi 5 dicembre 2001 16:30
@: sunhelp at sunhelp.org
Objet: [SunHELP] stty: : No such device or address
I've got some ksh scripts that when run via a cron job, the output
includes
the following:
stty: : No such device or address
This doesn't happen when the script is run in a terminal session.
Can this output be suppressed?
Thanks.
---------------------------------------------------------------
Edward F. Chase III | echase at providence.edu
Providence College | http://www.providence.edu
Computer Services | http://studentweb.providence.edu
Providence, RI 02918 |
_______________________________________________
SunHELP maillist - SunHELP at sunhelp.org
http://www.sunhelp.org/mailman/listinfo/sunhelp
More information about the SunHELP
mailing list