Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!iuvax!rutgers!njin!princeton!udel!mmdf From: V61%DHDURZ1.BITNET@cunyvm.cuny.edu (Ronald Lamprecht) Newsgroups: comp.os.minix Subject: ST (PC?): SH bug (was: Re: 'profile problems') Message-ID: <9195@louie.udel.EDU> Date: 20 Feb 89 10:47:29 GMT Sender: usenet@udel.EDU Lines: 56 In his article from 7 Feb 89 Gerry Wheeler suspected: > I can tell, the .profile is not being read or is not being processed. At least for the ST version the /etc/profile and the $HOME/.profile are executed in wrong sequence: $HOME/.profile is executed first and afterwards /etc/profile as you can easily check by inserting unique echo commands into both scripts. Of course one can easily exchange the both calls in 'sh1.c': Line 147: if ((f = open("/etc/profile", 0)) >= 0) 148: next(remap(f)); 149: if ((f = open(".profile", 0)) >= 0) what indeed causes the shell to execute the profiles in right order. But the current order in sh1.c should be the right one --- the bug must be located in a more general subroutine, because it causes trouble in other situations, too: Create a few shell scripts named 'bat1',... each consisting of a single unique statement: echo "bat1" ,... Now feed the shell with the following lines: 1) $ . bat1 ; . bat2 ; . bat3 Result: bat3 bat2 bat1 2) $ . bat1 ; echo "hello" ; . bat2 Result: hello bat2 bat1 3) $ . bat1 & Result: job ID (nothing else!) Knowing the results of these tests it's no wonder that the profiles are executed in the wrong order. Furthermore test 2 shows that our problem is not only a question of the execution order of script files. Therefore it may be not easy to fix this BUG -- I won't do it (the sources are not well commented), but perhaps the author (AST ?) may do it. Bitnet: V61@DHDURZ1 Ronald Lamprecht UUCP: ...!unido!DHDURZ1.bitnet!V61 Theoretische Physik ARPAnet: V61%DHDURZ1.BITNET@CUNYVM.CUNY.EDU (Heidelberg, West Germany)