unix system enhancements

Guy Harris guy at sun.uucp
Sat Sep 27 05:07:59 AEST 1986


> 	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 at sun.com (or guy at sun.arpa)



More information about the Comp.unix.wizards mailing list