Path: utzoo!attcan!uunet!mcvax!diku!dkuug!ambush!kimcm From: kimcm@ambush.UUCP (Kim Chr. Madsen) Newsgroups: comp.unix.wizards Subject: Re^4: Should ``csh'' be part of the System V distribution? Message-ID: <766@ambush.UUCP> Date: 20 May 88 09:48:28 GMT References: <2599@usceast.UUCP> <2601@usceast.UUCP> <10857@steinmetz.ge.com> <762@ambush.UUCP> <7924@brl-smoke.ARPA> Organization: AmbraSoft A/S (Denmark) Lines: 62 gwyn@brl-smoke.ARPA (Doug Gwyn ) writes: >In article <762@ambush.UUCP> I wrote: >>Bourne Shell (System V Version): >> - No easy alias mechanism (functions are inadequate) >How so? Functions are more general than aliases. Functions might be more general than aliases but can not in their present form replace aliases completely, nor can aliases replace functions. Don't misconstrue me I do like functions and I do like aliases. But the biggest difference between the two is that aliases works as textual substitution, whereas the functions is a piece of code being executed line by line with the given parameters. And the current implementation of functions doesn't allow you to redefine build-in functions, and messes your environment up with the functions code. >> - No history mechanism >One can be added easily enough. We have one in ours. You can also do >this much better using a separate process, for example "mux" running in >your terminal. Yes it can be added (almost) painless, if you happen to be in possession of the source code for the shell - this will work nice for you, but it's non standard. This means that the user's you've trained will be confused by being confronted with a standard shell. What I like to see is the history mechanism added to the standard Bourne shell. In fact I wish that csh's alias mechanism, ksh's history mechanism & (something like) tcsh's prompt mechanism was added to the Bourne Shell, thus we could drop some of the semi-standard shells like "csh" & "ksh" and have ONE common shell... >> - Offers only a one-time start-up script (.profile (/etc/profile)) >You can obtain .logout yourself by planting an exit trap in your .profile. >Csh sources .login and .cshrc in the wrong order, sources .cshrc even for >scripts, and the hardwired names are inflexible. BRL's shell uses the >ENV=file option to trigger our equivalent of .cshrc. Again as standard they only provide .profile and the common /etc/profile, this is good but not adequate. The trap solution can easily be worked around by redefining the trap condition, whereas a user prevented from changing his .logout will have it executed upon logout, unless he just "kill -9" his shell. I don't think that the csh's way of treating the .{cshrc,login} is perfect, but at least they do a good job and a job not performed in the Bourne shell. And again to make the Bourne shell able to do something like a .cshrc is not standard (which it should be) and therefore is a local hack (could you make it public?). Regards, Kim Chr. Madsen, AmbraSoft A/S, Rojelskaer 15, DK-2840 Holte (Denmark) UUCP: kimcm@ambush.dk, PHONE: +45 2424 111, FAX: +45 2423 090 You shouldn't say it's no good. You should say you do not like it; and then, you know, you're perfectly safe. -- James Abbott McNeill Whistler --