trap 2 on /etc/profile

Bud Hovell bbh at whizz.UUCP
Fri Sep 9 14:33:45 AEST 1988


>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.
>>After each 'trap' statement, remove the '2', and all terminals & the console
>>have this function available.
>
>Huh?
>Sounds like you screwed up your /etc/profile.  I've got no problems with using
>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.
>-- 
>John "C". Sucilla,  A silicon based life form.

If it's screwed up, John, then AT&T did the screwing - the script I was 
referring to wasn't my own backroom creation - it came with the year-old 3B1
that I bought, and has the official Death Star logo on the 3.51 discs, and
is unaltered by the 'a' upgrade.

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?

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?

Below is an excerpt of the original script baptized by AT&T and unsullied by
any of my subsequent changes. This should provide sufficient info for
assessing whether 'profile' scripts on other machines are/are not likewise
deliberately crippled:

============================================================================

#sccs	"@(#)fndetc:profile	1.7"

#
#  FILE:  /etc/profile
#	Initialization script for all logins.
#

trap '' 1 2 3

set `who -r`
if [ "$3" = "S" ]
then
	sync;sync;sync
	/etc/killall

	##  Any shutdown procedures (such as slancard reset) can be
	##  put in /etc/shutdaemon, and will be executed without
	##  changing /etc/profile.
	.
	.
	<more stuff>
	.
	.
	TERM=adm3
else
#						A Remote Login
	trap "exit" 1 2 3
	SHFLAG=0
	PHRASE=" "
	ADDEDINFO=", '?' for help, or 'exit' to exit,\n"
	while true
	do
	.
	.
	<more stuff>
	.
	.
set `df -t /`
AVSPACE=`expr ${3}00 / $8`
echo "\n           ${AVSPACE}% of the storage space is available."
cat /etc/motd
#ATATE IS THE ENVIRONMENT VARIABLE FOR dBASE III
ATATE=/usr/lib/dbase; export ATATE
trap 1 2 3
============================================================================

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.             :::::::::::::::::::::::::
                                                    |                       | 
               Bud Hovell                           | OVERTURE SYSTEMS CORP |   
             (503) 636-3000                         |    Lake Oswego, OR    |
                                                    |                       | 
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
| UUCP{attmail!, tektronix!tekgen!teksce!bucket!, pacbell!safari!}whizz!bbh |
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::



More information about the Unix-pc.bugs mailing list