- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- stty: : Unknown error
Categories
Company
Local Language
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
Forums
Discussions
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
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- 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
тАО02-03-2005 09:32 AM
тАО02-03-2005 09:32 AM
stty: : Unknown error
I am issuing the following commands:
whoami > /home/prandall/cmndslog.txt 2>&1
su - prandall >> /home/prandall/cmndslog.txt 2>&1
echo $SHELL >> /home/prandall/cmndslog.txt 2>&1
uname -a >> /home/prandall/cmndslog.txt 2>&1
whoami >> /home/prandall/cmndslog.txt 2>&1
In the log file I see the following results (the HP system may wrap where the oringal results didn't):
root
stty: : Unknown error
(c)Copyright 1983-2000 Hewlett-Packard Co., All Rights Reserved.
(c)Copyright 1979, 1980, 1983, 1985-1993 The Regents of the Univ. of California
(c)Copyright 1980, 1984, 1986 Novell, Inc.
(c)Copyright 1986-1992 Sun Microsystems, Inc.
(c)Copyright 1985, 1986, 1988 Massachusetts Institute of Technology
(c)Copyright 1989-1993 The Open Software Foundation, Inc.
(c)Copyright 1986 Digital Equipment Corp.
(c)Copyright 1990 Motorola, Inc.
(c)Copyright 1990, 1991, 1992 Cornell University
(c)Copyright 1989-1991 The University of Maryland
(c)Copyright 1988 Carnegie Mellon University
(c)Copyright 1991-2000 Mentat Inc.
(c)Copyright 1996 Morning Star Technologies, Inc.
(c)Copyright 1996 Progressive Systems, Inc.
(c)Copyright 1991-2000 Isogon Corporation, All Rights Reserved.
RESTRICTED RIGHTS LEGEND
Use, duplication, or disclosure by the U.S. Government is subject to
restrictions as set forth in sub-paragraph (c)(1)(ii) of the Rights in
Technical Data and Computer Software clause in DFARS 252.227-7013.
Hewlett-Packard Company
3000 Hanover Street
Palo Alto, CA 94304 U.S.A.
Rights for non-DOD U.S. Government Departments and Agencies are as set
forth in FAR 52.227-19(c)(1,2).
You have mail.
Not a terminal
stty: : Unknown error
stty: : Unknown error
3
1 1 1 1 1 1 1 1 1
logout
/sbin/sh
HP-UX hp9001 B.11.11 U 9000/800 3056282497 unlimited-user license
root
It appears that the su is attempted but then I get some stty errors, funny characters, and the logout.
Can anyone provide some assistance on why I am gettnig the stty errors? If so, how do I resolve them?
Thanks in advance.
Jeff
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-03-2005 10:04 AM
тАО02-03-2005 10:04 AM
Re: stty: : Unknown error
The .profile of user "prandall" needs to be checked. Since you are calling from a script the message "Not a terminal" is correct.
There may be some customisations in the .profile which is causing this error.
You can also check the forum for Bill Hassell's many reply on this issue. On more than 1 occasion he had explained about stty settings within a script, which I found very useful.
With regards,
Mohan.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-03-2005 02:30 PM
тАО02-03-2005 02:30 PM
Re: stty: : Unknown error
include
export TERM=vt100 in your /etc/profile and .profile of user
regds,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-03-2005 02:35 PM
тАО02-03-2005 02:35 PM
Re: stty: : Unknown error
Also, the 'su - prandall' will be closed when you go to the next step in the script. It won't do the 'echo $SHELL' within the prandall session, which can be seen by the "logout" message before the /sbin/sh in the output you pasted.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-03-2005 05:15 PM
тАО02-03-2005 05:15 PM
Re: stty: : Unknown error
su - prandall >> /home/prandall/cmndslog.txt 2>&1
The message with su command.You can check prandall user's .login or .profile files and
Modify about tset and stty.
like this (csh)
eval `tset -s -Q -m ':vt100' `
stty erase "^H" kill "^U" intr "^C" eof "^D" susp "^Z" hupcl ixon ixoff tostop
Ref-URL:
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=72142
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-04-2005 12:28 AM
тАО02-04-2005 12:28 AM
Re: stty: : Unknown error
Interesting. I thought I was just capturing what was being sent to the terminal.
So two follow up questions then:
1) How, within a script, can I get a copy of what is happening when I execute the commands within the script, without having to be at a terminal?
2) How do I maintain the su'd user's profile through the execution of the remainder of the script / commands?
Thanks,
Jeff
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-18-2005 01:28 AM
тАО03-18-2005 01:28 AM
Re: stty: : Unknown error
if tty -s
then
tabs
fi
or in a simplified form for a single command:
[ tty -s ] && stty erase "^H" kill "^U" intr "^C"
This same technique (if tty -s) must be used in .profile since it has some terminal commands too. Start by rewriting /etc/profile (some other suggestions are here too):
1. Replace:
cat /etc/copyright
with:
if [ tty -s ] && echo "The copyright notice can be read by typing: cat /etc/copyright"
(users will appreciate the reduction of login junk on the screen and your logfile will no longer have all that copyright stuff in it)
2. Replace *ALL* of this code:
# set term if it's not set
if [ "$TERM" = "" -o "$TERM" = "unknown" \
-o "$TERM" = "dialup" -o "$TERM" = "network" ]
then
eval `ttytype -s -a`
fi
export TERM
# set erase to ^H, if ERASE is not set
if [ "$ERASE" = "" ]
then
ERASE="^H"
export ERASE
fi
stty erase $ERASE
with:
if [ tty -s ]
then
eval $(ttytype -s)
sbin/stty erase "^H" kill "^U" intr "^C" eof "^D" -parity ixon ixoff
(NOTE: the use of tset is defintely not recommended--use ttytype in all profiles)
Now, to see every step of a script run in batch mode, the universal way (whether bacth or interactive) is to first exec the script with new I/O and then turn on tracing as in:
exec > /home/prandall/cmndslog.txt 2>&1
set -x
Now the script will send all output to the file in /var/tmp.
As far as maintaining the login environment, you change your execution to:
su - prandall -c /usr/bin/sh /home/prandall/myscript
and you put all your commands to be run as prandall into myscript. The key is that su starts a shell which lasts as long as the shell has something to do, ie, -c myscript.
Bill Hassell, sysadmin