HPE Community read-only access December 15, 2018
This is a maintenance upgrade. You will be able to read articles and posts, but not post or reply.
Hours:
Dec 15, 4:00 am to 10:00 am UTC
Dec 14, 10:00 pm CST to Dec 15, 4:00 am CST
Dec 14, 8:00 pm PST to Dec 15, 2:00 am PST
System Administration
cancel
Showing results for 
Search instead for 
Did you mean: 

stty kill signal not working with k shell

 
SOLVED
Go to solution
Ganesan R
Honored Contributor

stty kill signal not working with k shell

Hi,

stty kill ^U is not working with k shell. kill signal is suppose to erase all the contents on the command line we typed when we press ^U right?

But it is working perfectly on posix shell.

$HOME/.profile has the following
stty erase "^H" kill "^U" intr "^C" eof "^D"

I also tried setting the value in command line like this

#stty kill ^U

but still it is not working..

Any idea?
Best wishes,

Ganesh.
6 REPLIES
Steven E. Protter
Exalted Contributor

Re: stty kill signal not working with k shell

Shalom Ganesan,

Can you please post stty -a output?

Also take a look at the env, there could be issues.

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
Solution

Re: stty kill signal not working with k shell

are you sure its not working? what you see on the screen with ksh looks different, but behaviour is the same. posix shell will delete everything on the existing line on the screen. for ksh, the curosor is moved to the next line, and the previous line is thrown away...

so if you enter:

somejunk ^U ls /tmp

in both sh and ksh

then what you see on the screen will be slightly different, but everything up to and including the ^U won't be interpreted by the shell in either case

HTH

Duncan

HTH

Duncan
Ganesan R
Honored Contributor

Re: stty kill signal not working with k shell

$ stty -a
speed 38400 baud; line = 0;
rows = 42; columns = 125
min = 1; time = 0;
intr = ^C; quit = ^\; erase = ^H; kill = ^U
eof = ^D; eol = ^@; eol2 ; swtch
stop = ^S; start = ^Q; susp ; dsusp
werase ; lnext
-parenb -parodd cs8 -cstopb hupcl cread -clocal -loblk -crts
-ignbrk brkint -ignpar -parmrk -inpck istrip -inlcr -igncr icrnl -iuclc
ixon ixany ixoff -imaxbel -rtsxoff -ctsxon -ienqak
isig icanon -iexten -xcase echo echoe echok -echonl -noflsh
-echoctl -echoprt -echoke -flusho -pendin
opost -olcuc onlcr -ocrnl -onocr -onlret -ofill -ofdel -tostop

$ echo $SHELL
/usr/bin/ksh

$ grep stty .profile
stty erase "^H" kill "^U" intr "^C" eof "^D"
stty hupcl ixon ixoff

Best wishes,

Ganesh.
Ganesan R
Honored Contributor

Re: stty kill signal not working with k shell

Hi Duncan,

Got your point. It works as expected in ksh.

But why it is not showing on the screen. Is it the shell ability? In that case how the normal user will interpret the screen?
Best wishes,

Ganesh.

Re: stty kill signal not working with k shell

>But why it is not showing on the screen?

It seems to be working fine for me. If you have viraw, it erases the current line, otherwise it goes to the next:
$ sdfsf ^X
ff
Ganesan R
Honored Contributor

Re: stty kill signal not working with k shell

Thanks for all to your helps...
Best wishes,

Ganesh.