trap 2 on /etc/profile

Bud Hovell bbh at whizz.UUCP
Wed Sep 14 03:50:06 AEST 1988



In article <237 at tarkus.UUCP>, jcs at tarkus.UUCP (John C. Sucilla) writes:
<deleted: helpful pointers from John to me on where to find info on how to use
	  traps correctly, and offering to help by swapping/fixing /etc/profile
	  scripts>

> 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.

No, John, as the evidence will now show, I have only myself to be angry with,
and certainly not you. As it turns out, you have been right on all counts, and
I most certainly *did* screw up - not just once, but in sufficiently numerous
ways to be rightly chagrined. To put it mildly.

Given that that is so, I am glad you pressed the point, since my original
posting would fully qualify as 'disinformation' that would cause even the KGB
to blush with envy. The reference to 'amateur' was directed more at me than
you, but it obviously missed the mark widely.

I hope that apology - along with the following explanation of how this all
transpired - will suffice.

> 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

Thank you. Your offer is more gracious than is deserved. While I can offer no
reasonable excuse for what follows, I feel duty-bound to retract bad information
that I put out, now that I've had a bit of time to reconstruct events:

First, what prompted me to make the original posting was an event that occurred
the other day when I tied in two other sites to my database thru a shell script
that is executed on logon and allows several menu options, one of which is to
call an appropriate Informix user menu, and then (after completing a session)
depart gracefully. Both of these machines are 7300/3B1s, running the same OS
as mine (3.51a).

After the linkup, I immediately got calls from both of these users saying that
they weren't able to get their <del> keys to work when they entered into the
database under terminal emulation. They are both using their consoles, and
have no terminals. (On my machine, I my 610 the terminal almost exclusively,
for reasons that don't matter here).

"OH, yeah", I then said to myself, "I forgot that I had the same problem and
had to make a change to the 'trap' statements in the profile script in order
to clear it."

'Checked my script, went and changed theirs to match, and it suddenly occurred
to me that others might want the same info - so I posted the original notice
(God help me :-) and went blazing on into early morning with other tasks.

What I had forgotten was that a change *had* been made to my original script
(back-when) that allowed login on my 610 terminal without the need for my
manually telling it (every dratted time!) that the tty000 terminal was a 610.
And what I didn't know was that this change (somehow!) got copied over into
the "original" copy that I keep on file, which I thought to be the virgin out
-of-the-box version 1.7 profile that came with the machine. So I thought I was
working with the original. Which is what I told you. Which was dead wrong!

(My errors were by now compounding geometrically).

And here was that change (in context) that actually *had* been made to the
/etc/profile script:

----------------------------------------------------------------------
####################### ALL VANILLA FROM TOP #########################
.
.
.
NAME=`tty`
if [ \( "`expr $NAME : '/dev/w' `"      != "0" -o \
	"`expr $NAME : '/dev/sys' `"    != "0" \) ]
then
#						A Console Window 
	TERM=s4
elif  [ "`expr $NAME : '/dev/con' `" != "0" ]
then
#						A Windowless Console
	TERM=adm3
######################### THIS WAS ADDED #############################
# Entry for system with 610 Terminal on tty000:
elif  [ "`expr $NAME : '/dev/tty000' `" != "0" ]
then
#						A 610 Terminal
	TERM=610
#################### BACK TO VANILLA, HEREAFTER ######################
else
#			    			A Remote Login
	trap "exit" 1 2 3
	SHFLAG=0
.
.
.
----------------------------------------------------------------------

But, even though I then no longer had to log in the terminal name, suddenly
the <del> key on the terminal wouldn't work in INFORMIX. (It seems to me
this occurred *only* in that application, now, but am now unwilling to
swear to much of anything). Same problem on the console, as I recall.

The "fix" - made by trial and error - was to remove the trap 2 - and everything
worked! That problem solved, I was then free to move on to far more prodigious
mischief-making during the intervening months until the other day :-).

Anyhow, mia culpa - I blew it big-time with unclear recollection and presen-
tation of the "facts". Sorry this took excessive bandwidth on the net.

John, I will call or E-mail you in a few days to take you up on your offer,
after I can get some other things completed. And maybe get a chance to look
at the script more closely and do some testing, in light of the information
you already have offered.

At least hereafter my ignorance needn't provide the source of (admittedly
limited) public amusement :-).
                                                    :::::::::::::::::::::::::
                                                    |                       | 
               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