Simpler Navigation for Servers and Operating Systems
Completed: a much simpler Servers and Operating Systems section of the Community. We combined many of the older boards, so you won't have to click through so many levels to get at the information you need. Check the consolidated boards here as many sub-forums are now single boards.
Showing results for 
Search instead for 
Did you mean: 

Handling 'tty' messages in mail headers

Go to solution
Jeffrey Davis_1
Frequent Advisor

Handling 'tty' messages in mail headers

Hi all. I'm on a N-class w/UX-11.00
I get the following 'tty' related messages in my mail messages and am wondering how to strip them out without having any adverse effects on things. I'm thinking that they are effects from 'tty' lines in either /etc/profile or user ~/home/.profile files. Any advice on dealing with these would be helpful.
Thanks in advance,

i.e. messages in mail:
From ...
Date: ....
From: System <...>
Subject: cron

ttytype: couldn't open /dev/tty for reading
stty: : Not a typewriter
You have mail.
Not a terminal
stty: : Not a typewriter
stty: : Not a typewriter

Jeff Schussele
Honored Contributor

Re: Handling 'tty' messages in mail headers

Hi Jeffrey,

Good question - great name.

Your cron commands are "pulling" these msgs in as they spawn shells for execution.

See Clay's post from yesterday (Plan B):,,0x21c20bce6f33d6118fff0090279cd0f9,00.html

Basically what you want to do is wrap a test for terminal around the commands in /etc/profile & ~user/home/.profile that are interactive & tset them

This would need to be done for any cron allowed user's .profile.

PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!
Steve Steel
Honored Contributor

Re: Handling 'tty' messages in mail headers


You can do this

Enclose the interactive term commands with if !

if ( { test -t 0 } ) then


{ test -t 0 }will return true or false,0 or 1 status depending upon whether the file descriptor is associated with a terminal device. If not a terminal then dont do the terminal based commands.
See the man page for the test command.

Steve Steel
If you want truly to understand something, try to change it. (Kurt Lewin)