HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- stty not a typewriter message
Operating System - HP-UX
1833300
Members
2901
Online
110051
Solutions
Forums
Categories
Company
Local Language
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
back
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Go to solution
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-31-2005 05:46 AM
05-31-2005 05:46 AM
Hi,
A .profile for a certain user on our system has been recently changed to reference some stty commands being set such as:
stty erase "^H" kill "^U" intr "^C" eof "^D"
Our batch processes on our system run as this user by su - and these processes then get run as this user. These are now erroring out saying: "stty not a typewriter." They have worked fine prior to this. Could this problem be related to the stty commands being set in the profile of this user?
Would anyone have any tips for this situation?
Thanks,
-Ken
A .profile for a certain user on our system has been recently changed to reference some stty commands being set such as:
stty erase "^H" kill "^U" intr "^C" eof "^D"
Our batch processes on our system run as this user by su -
Would anyone have any tips for this situation?
Thanks,
-Ken
Solved! Go to Solution.
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-31-2005 05:50 AM
05-31-2005 05:50 AM
Solution
This is perfectly normal and is why I never su - user anything but only su user and have both the user's .profile and the batch comand source a file that sets and exports and needed environment variable via the . (dot) operator.
In your case, the workaround is to surround any commands in .profile that expect an interactive environment (ie stdin, file descriptor 0, is a terminal) with
if [[ -t 0 ]]
then
stty ..
tabs ..
tset ...
fi
In your case, the workaround is to surround any commands in .profile that expect an interactive environment (ie stdin, file descriptor 0, is a terminal) with
if [[ -t 0 ]]
then
stty ..
tabs ..
tset ...
fi
If it ain't broke, I can fix that.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-31-2005 06:06 AM
05-31-2005 06:06 AM
Re: stty not a typewriter message
Batch processes will run into this from time to time. The reason is that terminal and stty settings are not set.
This command caused the issue whether this is a batch or interactive shell issue:
stty erase "^H" kill "^U" intr "^C" eof "^D"
I would back this change out or set stty settings for your users to the way they need to be.
In general, when I see this in batch, I ignore it except for oracle which sometimes refuses to tolerate certain stty settings when an application shells to the OS.
SEP
This command caused the issue whether this is a batch or interactive shell issue:
stty erase "^H" kill "^U" intr "^C" eof "^D"
I would back this change out or set stty settings for your users to the way they need to be.
In general, when I see this in batch, I ignore it except for oracle which sometimes refuses to tolerate certain stty settings when an application shells to the OS.
SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-31-2005 07:14 AM
05-31-2005 07:14 AM
Re: stty not a typewriter message
Clay described the problem. When you run a batch process (using cron, at or through remsh, etc) the script does not login (and consequently has no terminal). Tyerefore, every command to control a terminal such as stty, tabs, clear, tput, ttytype, tset, etc) will fail with the "typewriter" message. So your batch jobs must exclude such commands.
However, su - user will perform a pseudo-login by running /etc/profile and .profile and these often (and should) contain terminal commands. As Clay mentioned, you can drop the - option to just switch users but then none of the /etc/profile and .profile settings will occur...you have to explicitly set these in your script.
Or you can exclude them in /etc/profile and .profile (so you can indeed use su - user) and the errors go away. I prefer fixing /etc/profile and .profile because changes made in those scripts are occasionally made and sysadmins may forget to update the application scripts. There are several ways to detect if the script is running without a terminal. Here is another way using tty:
if tty -s
then
stty ...
tabs ...
fi
It is a good idea to collect all the terminal commands in a script and group them together so there will only be 1 test needed for a terminal connection.
Bill Hassell, sysadmin
However, su - user will perform a pseudo-login by running /etc/profile and .profile and these often (and should) contain terminal commands. As Clay mentioned, you can drop the - option to just switch users but then none of the /etc/profile and .profile settings will occur...you have to explicitly set these in your script.
Or you can exclude them in /etc/profile and .profile (so you can indeed use su - user) and the errors go away. I prefer fixing /etc/profile and .profile because changes made in those scripts are occasionally made and sysadmins may forget to update the application scripts. There are several ways to detect if the script is running without a terminal. Here is another way using tty:
if tty -s
then
stty ...
tabs ...
fi
It is a good idea to collect all the terminal commands in a script and group them together so there will only be 1 test needed for a terminal connection.
Bill Hassell, sysadmin
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Events and news
Customer resources
© Copyright 2025 Hewlett Packard Enterprise Development LP