🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: cmu.cs.general
Article #149

Re: Help with .xinitrc problem

#149
From: Gerry Roston
Date: Tue, 06 Apr 1993 17:37
52 lines
3172 bytes
I received a number of replies to my query.  The following one does
work, as I am succesfully using it, and the second may also work as it
addresses the same issue. 

Thanx to all who replied.

-- From Darrell Kindred --The problem is that your .xinitrc is being interpreted by /bin/sh, not
/bin/csh.  If you make your .xinitrc executable, it should take care
of the problem.  Here's the relevant code from xinit.c (vec[0]
contains "/usr/gerry/.xinitrc", SHELL is "sh"):
	
    execvp (vec[0], vec);
    if (access (vec[0], R_OK) == 0) {
	vec--;				/* back it up to stuff shell in */
	vec[0] = SHELL;
	execvp (vec[0], vec);
    }

So if .xinitrc is executable, the first execvp will succeed, and
/bin/csh will be used to interpret .xinitrc (since you have the
#!/bin/csh line at the top).  The backup execvp just does a 
"sh /usr/gerry/.xinitrc".  The "#!/bin/csh" line must be ignored by
sh, since otherwise it could get into an infinite loop.


-- from Conrad Poelman --

My guess is that xinit is not using csh, but is using the Bourne shell
(sh) to run your .xinitrc file.  You can fix this by either changing
your .xinitrc to use sh-style if...then...elif...fi commands, or tell
xinit to use a csh by executing:
	exec xinit /bin/csh .xinitrc -- [...]
or
	exec xinit $SHELL .xinitrc -- [...]
in your startup script.  I don't think it looks at the #!/bin/csh -f you
have at the top of your .xinitrc file because it doesn't actually exec
the .xinitrc file, it just sources it.

--


--
Gerry Roston (gerry@cmu.edu)    | It would be almost unbelievable, if history
Field Robotics Center,          | did not record the tragic fact, that men have
Carnegie Mellon University      | gone to war and cut each other's throats
Pittsburgh, PA, 15213           | because they could not agree as to what was to
(412) 268-3856                  | become of them after their throats were cut...
                                | For some reason, too deep to fathom, men
The opinions expressed are mine | contend more furiously over the road to
and do not reflect the official | heaven, which they cannot see, than over their
position of CMU, FRC, RedZone,  | visible walks on earth.  Walter Stacey
or any other organization.      | 
Technical Details
Message-ID: <GERRY.93Apr6123748@onion.cmu.edu>
Path: arc1-ca.pugleaf.net!gmd.de!newsserver.jvnc.net!howland.reston.ans.net!europa.eng.gtefsd.com!fs7.ece.cmu.edu!crabapple.srv.cs.cmu.edu!netnews.srv.cs.cmu.edu!gerry
References: <GERRY.93Apr5190633@onion.cmu.edu>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 103734,623077f50f134bea
X-Google-Attributes: gid103734,public
X-Google-Thread: fb37e,623077f50f134bea
X-Google-Attributes: gidfb37e,public
X-Google-ArrivalTime: 1993-04-06 10:38:27 PST
Newsgroups: cmu.cs.general,comp.windows.x
Path: arc1-ca.pugleaf.net!gmd.de!newsserver.jvnc.net!howland.reston.ans.net!europa.eng.gtefsd.com!fs7.ece.cmu.edu!crabapple.srv.cs.cmu.edu!netnews.srv.cs.cmu.edu!gerry
From: gerry@cmu.edu (Gerry Roston)
Subject: Re: Help with .xinitrc problem
In-Reply-To: gerry@cmu.edu's message of Tue, 6 Apr 1993 00:06:33 GMT
Message-ID: <GERRY.93Apr6123748@onion.cmu.edu>
Sender: news@cs.cmu.edu (Usenet News System)
Nntp-Posting-Host: onion.frc.ri.cmu.edu
Reply-To: gerry@cmu.edu (Gerry Roston)
Organization: Field Robotics Center, CMU
References: <GERRY.93Apr5190633@onion.cmu.edu>
Date: Tue, 6 Apr 1993 17:37:48 GMT
Lines: 52