1832978 Members
3121 Online
110048 Solutions
New Discussion

stty -a

 
SOLVED
Go to solution
jerry1
Super Advisor

stty -a

Can someone tell me why I have stty susp on this one system. I cannot do a ^z to background processes unless I set it myself.
I thought this was set by default.

The other systems have susp = ^Z after login.
Checked all source files for login.
root using /sbin/sh.

HP-UX 11.0.

6 REPLIES 6
Sridhar Bhaskarla
Honored Contributor
Solution

Re: stty -a

Hi,

There are may be quite a few reasons why it got changed. One is a previous reset of these options by redirecting the stdin to /dev/ttyconf.

You can set it back by redirecting stdin to the device /dev/ttyconf

For ex., you would set susp to ^Z by

stty susp ^Z < /dev/ttyconf

From next login onwards, it will set the suspend character to ^Z.

-Sri
You may be disappointed if you fail, but you are doomed if you don't try
Paddy_1
Valued Contributor

Re: stty -a

Did you look at /etc/profile ?
If so has it recently changed.

Check for .profile entries like this
---------------
stty susp ^z
stty intr ^c
stty eof ^d
----------

The simple solution is to add these to your shell startup profile wherever it is.

The sufficiency of my merit is to know that my merit is NOT sufficient
jerry1
Super Advisor

Re: stty -a

It works. That is cool. How does that work exactly.

stty susp ^Z < /dev/ttyconf


A. Clay Stephenson
Acclaimed Contributor

Re: stty -a

The answer to that lies in the stty man pages. Look under "Control Character Default Assignments". Note that this device can only be accessed by root. The /dev/tty device is YOUR terminal device no matter what you are physically connected to. It saves you the trouble of having to determine the actual port in use.
If it ain't broke, I can fix that.
Sridhar Bhaskarla
Honored Contributor

Re: stty -a

Hi,

Look at the man page for more information. Particularly

//The default values for the control characters may be changed by a user
with root capability by using stty and redirecting stdin to the device
/dev/ttyconf//

See one of the examples given also.

There was a bug with make_sys_image (run by make_tape_recovery/make_net_recovery) that it was modifying the defaults for /dev/ttyconf. Yours could have been this case.

-Sri
You may be disappointed if you fail, but you are doomed if you don't try
Bill Hassell
Honored Contributor

Re: stty -a

I always have the following in /etc/profile:

if tty -s
then
eval $(ttytype -s)
stty erase "^H" kill "^U" intr "^C" eof "^D" -parity ixoff
stty susp \^Z dsusp \^Y
fi

The above code figures out your terminal type (only when /etc/profile is run from an interactive session) and sets the most important stty values for your terminal session. /dev/ttyconf is a global device file used to set permanent stty values, for example, to make backspace work during login.


Bill Hassell, sysadmin