trap 2 on /etc/profile

John C. Sucilla jcs at tarkus.UUCP
Mon Sep 12 01:12:22 AEST 1988


In article <346 at whizz.UUCP> bbh at whizz.UUCP (Bud Hovell) writes:
>>In article <344 at whizz.UUCP> bbh at whizz.UUCP (Bud Hovell) writes:
>>>On the 3B1/7300, '/etc/profile' has a trap statement that disables the <del>
>>>key, which is very desireable to have when you are working in Informix.

>>my delete key over here on my 3B1.  The last line in my /etc/profile reads:
>>trap 1 2 3
>>Which disables all the traps before ~me/.profile is invoked.

>It *is* possible that there are different scripts - I really don't know. But
>there are a total of 3 (three) trap statements in my script. It is version
>1.7. The same came on my partner's 3B1, purchased in April. Is yours?

Mine is version 1.5.  I'm running 3.50 UNIX upgraded to 3.5.1.4.  Mine also
has a total of three trap's.

>Also, I am a bit unclear on your intended meaning when you describe how a
>'trap 1 2 3' statement "disables" the traps - it specifically *enables* traps
>1, 2, and 3 - trap 2 being the specific villain which must be removed in 
>order that the interrupt NOT be trapped (that is, hit in the head) when you 
>use the <del> key. (At least Kernighan thinks it works that way: see page 150
>of The UNIX Programming Environment).
>
>Or are we RTFMing out of different hymnals?

Yes, we are.  I looked at the page you referenced in that book and saw that it
explains how to set up traps but says absolutely nothing about how to turn them
off.  Look at sh(1) in your UNIX Users Manual, turn to the page that describes
'trap' and you will see the following:

    trap [arg] [n]...
          .
          .
    If arg is absent then all trap(s) n are RESET to to their original values.

The last line in /etc/profile says: trap 1 2 3, which as I stated before,
disables (resets, whatever you want to call it) the signals for hangup,
interrupt and quit back to their default values which is "don't intercept
them".

>If Rick Calder (or other ATT UNIX PC guru) would like to step into this
>amateur discussion to offer the final word (this is mine), it would be fine
>by me.

Are you mad at me?  I was just trying to help...  By the way, I'm no amateur.
I've been working with UNIX for about seven years now.

I'm willing to mail you a copy of my version 1.5 script since you apparently
have a legal copy of 3B1 UNIX.  If you want it, let me know.  I think it's
worth a try.  If your problem with the delete key continues you would know
that it wasn't /etc/profile thats giving you grief, the problem would have to
be some other script thats getting executed after /etc/profile.

I'd also like to see your version 1.7 script (I have a legal copy too), I'll
try it over here and see if the same thing happens.  Send it to me if you'd
like.  If it acts the same here I'll fix it and send it back to you.
-- 
John "C". Sucilla,  A silicon based life form.
       {att,chinet,ddsw1}!tarkus!jcs
  You have a better idea? Now's the time..



More information about the Unix-pc.bugs mailing list