Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: utzoo!mnetor!lsuc!dave
From: dave@lsuc.uucp (David Sherman)
Newsgroups: comp.cog-eng,comp.unix.xenix,comp.unix.wizards
Subject: Re: Request for human interface design anecdotes
Message-ID: <1987Dec2.233535.14242@lsuc.uucp>
Date: Wed, 2-Dec-87 23:35:34 EST
Article-I.D.: lsuc.1987Dec2.233535.14242
Posted: Wed Dec  2 23:35:34 1987
Date-Received: Sat, 5-Dec-87 17:45:29 EST
References: <3846@elecvax.eecs.unsw.oz>
Reply-To: dave@lsuc.UUCP (David Sherman)
Organization: Law Society of Upper Canada, Toronto
Lines: 43
Summary: chdir spelling correction in sh
Xref: mnetor comp.cog-eng:342 comp.unix.xenix:1255 comp.unix.wizards:5755

cameron@elecvax.eecs.unsw.oz (Cameron Simpson) writes:
>I once used something calling itself `nsh' on a System V machine, and typed
>	$ cd thnig
>and thought "bother, I meant `thing'" and was then disconcerted when it said
>	path/thing
>	$
>back at me. It had fixed the transposed chacters and dropped me in the right
>spot! Hopefully it only happened in interactive mode, but it was very
>disconcerting.

We have that in our Bourne shell here.  You get used to it very
quickly, and it's VERY handy.  Yes, it only works in interactive mode.

As far as I remember, the origins of spelling-correction for chdir
in sh go back to Tom Duff adding it to the v6 shell at U of Toronto
around 1976 or so.  I then pulled out td's spname() routine and
began plugging it into other utilities on our v6 11/45, when
used interactively (p, cmp, and a few others).  The routine
accompanied Rob Pike on his travels when he left U of T, and
it shows up in Kernighan & Pike (with credit to Duff, I believe;
don't have a K&P handy).

In the original version, it would ask you:
	$ cd /ibn
	cd /bin? y
	$
The version of sh currently on our system (I got this part
from sickkids!mark) doesn't bother asking, which I think is right
because you often type ahead and don't want some command swallowed
as an answer to "cd foo?".  It just does it:
	$ cd /ibn
	cd /bin
	$

If anyone with a source license wants the code in sh to
implement this, let me know.  It's pretty trivial once you have
spname(3), which we use all over the place now (more(1), for example).

David Sherman
The Law Society of Upper Canada
-- 
{ uunet!mnetor  pyramid!utai  decvax!utcsri  ihnp4!utzoo } !lsuc!dave
Pronounce it ell-ess-you-see, please...