From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from cortex.physiol.su.oz.au ([129.78.131.10]) by hawkwind.utcs.utoronto.ca with SMTP id <24056>; Thu, 2 Nov 1995 23:41:04 -0500 Received: (john@localhost) by cortex.physiol.su.oz.au (8.6.11/8.6.4) id PAA19841 for rc@hawkwind.utcs.toronto.edu; Fri, 3 Nov 1995 15:40:41 +1100 From: John (Watching the Wheels) Mackin Date: Thu, 2 Nov 1995 23:30:40 -0500 To: rc@hawkwind.utcs.toronto.edu Subject: Clean design pays dividends -- and stupid kludges don't Message-ID: <199511031530.18948.software.babaz@physiol.su.oz.au> X-Face: 39seV7n\`#asqOFdx#oj/Uz*lseO_1n9n7rQS;~ve\e`&Z},nU1+>0X^>mg&M.^X$[ez>{F k5[Ah<7xBWF-@-ru?& @4K4-b`ydd^`(n%Z{ Hi. Those of you who have been on this list for a while may remember me -- fond greetings to all old-timers! I haven't resubscribed (I can't at this stage) but I have come across something in recent months that I have decided cries out to be mentioned here. You see, I now have a computer at home -- something I resisted through all the many years of my professional life (with computers). But now that I am no longer working, I really need something at home to do writing on, and keep track of my (paper) files, and like that. Of course the fact that I am no longer working also means that I have nothing to spend on such a computer, so I am (still, after two years) building one out of parts I can scavenge. That one, when finished, will be big enough to run FreeBSD so I will be able to use rc as my shell as always, and there will be no problem. But it is taking so long to build that I really needed a stopgap, and I had enough hardware to build a stopgap machine. The thing is that it (on which I am indeed typing this mail! -- I will sneakernet it in to University later in order to send it) is only a 286, so it can't run any reasonable kind of Unix. So I'm stuck with MS-DOS -- and therefore I cannot use rc (as far as I know! -- I'd be _delighted_ as well as astonished to hear that someone has done a DOS port). But I do at least have the some command binaries that make the thing look enough like Unix most of the time that I am much more comfortable than I would be with raw DOS. Now we are getting to the point of this posting: the shell I have is a port of ksh. I never used ksh on Unix but was basically familiar with its offerings. Now, I use it all the time, and of course I do not like it. But the worst thing is its history. Not only does it not (seem to, perhaps I just can't figure out how) offer any way to preserve your history effectively from one login session to the next -- something I always do with my rc history files on Unix, and which I like very much; and of course with a true external history file, it's your option -- but worse still, it has stupid "features" that interact badly (read: don't interact at all). Consider this real example: I've been writing a letter to someone. I think I have finished: $ spell theletter ... The spell output looks all right. I'll print it now: $ lpr $_ For those list-readers who are lucky enough to not know, this is a ksh idiom. $_ is set to the last argument of the previous command. It's a handy kludge, since a lot of the time in Unix the last argument is the file you're currently doing something or other to, as in this case. All right, it's printing now. Gee, I wonder what time it is? $ date ... Oh, not too late. I'd better print another copy of the letter to go into the filing cabinet, so I use the built-in ksh history, expecting to re-execute the command I did a moment ago: it's (in this case) vi-like, so I type , then "k" once -- and see $ date then "k" again, and see: $ lpr $_ and then I think "Bugger! If I type now to execute this, I know damn well what I would get -- yes, you guessed it, I'd get `lpr date'." (let ((sarcastic #t)) Wonderful, wonderful work, guys. Well-designed, clean interface. ) I will be very happy indeed when I can give ksh the big flick, and go back full-time to my best friend in shells, rc. OK, John.