Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!uunet!aplcen!haven!umbc3!bernie From: bernie@umbc3.UMBC.EDU (Bernard J. Duffy) Newsgroups: comp.sys.sgi Subject: Re: PI Problems Summary: /etc/cshrc (and ~/.login) doesn't get run when xterm-ed in Keywords: cshrc /etc/motd /etc/cshrc xterm-logins Message-ID: <2836@umbc3.UMBC.EDU> Date: 26 Feb 90 20:28:23 GMT References: <9002220905.aa28986@VAT.BRL.MIL> <51649@sgi.sgi.com> Reply-To: bernie@umbc3.umbc.edu.UMBC.EDU (Bernard J. Duffy) Organization: University of Maryland, Baltimore County Lines: 56 In article <51649@sgi.sgi.com> brendan@illyria.wpd.sgi.com (Brendan Eich) writes: >In article <9002220905.aa28986@VAT.BRL.MIL>, jra@BRL.MIL ("John R. Anderson", VLD/ASB) writes: >> 1. The other day, I changed the net addresses on our PI's, and >> at the same time I happened to place a notice to the user's in /etc/motd. >> ... some of this deleted .... > >The BSD rcp protocol is fragile: as the friendly manual page says in its >BUGS section: > > [Rcp is] confused by any output generated by commands in a .login, > .profile, or .cshrc file on the remote host. > >The problem is not having a non-empty /etc/motd on the remote host, but >the fact that the remote user's .profile or .cshrc file cats /etc/motd >(the above-quoted warning about .login is erroneous -- the remote half of >rcp uses does not involve a login shell, so .login is not sourced). > >Csh users can cat motd-like files from their .login files. But users of >any shell shouldn't need to cat /etc/motd, as /etc/profile and /etc/cshrc >do so for all login shells upon startup. But what about X-term users. I noticed that xterminal sessions (logins) into the SGI machines don't have the benifit of /etc/cshrc (don't know about /etc/profile for sh users.. don't have any). And not only does that not get executed, neither does the .login ! So, the only way to get /etc/motd is to do it in the ~.cshrc as I've done below to get once : if ($?prompt) then # Prompt was set... for interactive session/ not process command if !($?BJD_ETC_CSHRC) then if ($?DISPLAY) then source /etc/cshrc endif setenv BJD_ETC_CSHRC 1 endif #... endif > >Brendan Eich >Silicon Graphics, Inc. >brendan@sgi.com This isn't an SGI-only problem, I've noticed this with DEC's Ultrix as well, but had an easier time working the .cshrc since SGI's setup of the DISPLAY is a bit sloppy (sets DISPLAY even thought there's no Xterm... convience for the "console" user to run x programs while in wsh). There may be a solution to this, but I haven't accidently run acrossed it yet. Bernie Duffy. -- Bernie Duffy Systems Programmer II | Bitnet : BERNIE@UMBC2 Academic Computing - L005e | Internet : BERNIE@UMBC2.UMBC.EDU Univ. of Maryland Baltimore County | UUCP : ...!uunet!umbc3!bernie Baltimore, MD 21228 (U.S.A.) | W: (301) 455-3231 H: (301) 744-2954