1834299 Members
2490 Online
110066 Solutions
New Discussion

control C not set up

 
SOLVED
Go to solution
Ratzie
Super Advisor

control C not set up

How do you set up the control C (EOF) in your enviroment.
6 REPLIES 6
Pete Randall
Outstanding Contributor
Solution

Re: control C not set up

In /etc/profile (for all users), we put the following:

#########################################################
# Set up the terminal:
#########################################################
if [[ -t 0 ]]
then
eval ` tset -s -Q `
stty erase "^H" kill "^U" intr "^C" eof "^D"
stty hupcl ixon ixoff
stty susp ""
stty dsusp ""
tabs
fi


Pete

Pete
Fred Ruffet
Honored Contributor

Re: control C not set up

with the stty command.
stty KILL ^C

Regards,

Fred
--

"Reality is just a point of view." (P. K. D.)
Steven E. Protter
Exalted Contributor

Re: control C not set up

Depends on your terminal setup but the basic setup is usually stty setup in /etc/profile

Attaching an example.

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
Ratzie
Super Advisor

Re: control C not set up

I have had a look at your script, thankyou. I have question relating to your root login.

What are you doing below... What is a terminal file?


chkname=`who am i | awk {'print $1'}`


if [ "$chkname" = "root" ]
then
echo "..........."
else
# echo "making the terminal file secure from hackers."
mesg n >/dev/null
fi

if [ "$LOGNAME" = "root" ]
then
echo "Native root login. Securing the terminal file."
mesg n >/dev/null
fi
Muthukumar_5
Honored Contributor

Re: control C not set up

We have to setup with stty command to enable EOF as,

stty intr "^C" on /etc/profile (normal users)

And for,
chkname=`who am i | awk {'print $1'}`
if [ "$chkname" = "root" ]
It is real root user's (when login) not the step up users with su.


if [ "$LOGNAME" = "root" ]
It will be applicable to root users (when they login and step up users with su command )

Get all stty settings as,
stty -a

Easy to suggest when don't know about the problem!
Ratzie
Super Advisor

Re: control C not set up

Thanks