Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!watmath!clyde!cbatt!ihnp4!qantel!lll-lcc!pyramid!decwrl!sun!guy From: guy@sun.uucp (Guy Harris) Newsgroups: net.unix-wizards Subject: Re: unix system enhancements Message-ID: <7676@sun.uucp> Date: Fri, 26-Sep-86 15:07:59 EDT Article-I.D.: sun.7676 Posted: Fri Sep 26 15:07:59 1986 Date-Received: Tue, 30-Sep-86 06:42:29 EDT References: <4120@brl-smoke.ARPA> Organization: Sun Microsystems, Inc. Lines: 35 > 1. Modify CSH so that it checks for the existence of a system wide > .cshrc and .login (obviously they could have different names) before > reading the users .cshrc and .login. This would allow the system > manager (me) to create a standard environment without having to write > each user a .login and .cshrc and still allow the user to modify his > or her environment if they choose. Yes, several people have done this to the C shell, most of them probably inspired by the similar feature in the S3/S5 Bourne shell; those versions of the Bourne shell read "/etc/profile" before they read ".profile". I don't know if any of them had a system-wide ".cshrc", but they all had system-wide ".login"s. The trouble is that several people have done this, all giving the file a different name. I think Plexus called it "/etc/cshlogin"; at CCI, I called it "/etc/login" (this won't work in System III, where the "login" program was moved to "/etc", but System V moved it back to "/bin"); you could also call it "/etc/.login", but that means "ls /etc" won't show it unless "ls" is showing "." files. Karl Kleinpaste at Bell Labs Columbus called it "/etc/csh.login", as his also had to run on System III. One S3/S5 Bourne shell feature used by "/etc/profile" is that in an interactive shell, "$0" refers to the argv[0] of the shell that is running, so that it can tell whether it was invoked as "-sh", "-rsh", "-su", or other. (The S5/S5 "login" doesn't do things like checking for mail, printing the message of the day, etc.; it leaves that up to "/etc/profile", or whatever your other login shells do.) In Karl's C shell, "$0" was the argv[0] of the shell for interactive shells. In order not to break existing scripts, "$?0" was true only for scripts, not for interactive shells. You out there, Karl? What ever happened with that version of the C shell? -- Guy Harris {ihnp4, decvax, seismo, decwrl, ...}!sun!guy guy@sun.com (or guy@sun.arpa)