[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: SIGINT handling in bash 3
From: |
Shaw |
Subject: |
Re: SIGINT handling in bash 3 |
Date: |
Fri, 19 Nov 2004 12:18:53 -0500 |
Hi Chet,
> Run `trap' after logging in with bash as your login shell. If it
> reports SIGINT as ignored or trapped and running a strange-looking
> command, look at /etc/profile. Chances are good it contains
> something like `trap 2 3', which is deprecated syntax and ends up
> running the command `2' when signal 3 is received.
Thanks for your suggestion. I checked /etc/profile before I posted my
original email and did see the deprecated syntax. I changed this to
'trap - 2 3' (after first testing without signal handling altogether)
in the case of a bash shell.
After doing this, I noticed that pressing CTRL-c at the command prompt
issued a CR, which it does when not run as a login shell. I tested
again just now and though I am still unable to CTRL-c out of a `tail
-f` or `find`, for example, I am able to end the process by sending it
a SIGINT with `kill` from another shell. This was not possible before
the change to /etc/profile, and something that I had overlooked in
previous tests. Thank you for getting me back on track; this is a big
step forward!
I do not think this is limited to CTRL-c, however, as CTRL-z does not
suspend the `tail` or `find` either. I've used 'bind' to map some of
my CTRL keys, and those work fine. This is starting to look more like
a key mapping problem now, as processes are definitely responding to a
SIGINT. Any other pointers in the right direction?
A RTFM seems appropriate at this point- but, please include the name
of the manual. :)
Thanks again,
Shaw