Input Line Editing

Brandon S. Allbery allbery at ncoast.UUCP
Sat Jul 23 09:18:33 AEST 1988


As quoted from <9666 at eddie.MIT.EDU> by nessus at wonko.MIT.EDU (Doug Alan):
+---------------
| In article <16456 at brl-adm.ARPA> rbj at nav.icst.nbs.gov (Root Boy Jim) writes:
| > I suspect that the real place for line editing is either in the shell
| > itsef (as in tcsh, ksh, (and brlsh?)) or in the kernel.
| 
| Putting line editing in the shell is wrong, because it should work in
| all programs and be consistent.  Putting it in the kernal is gross.
| Thus, the right place to put it is precisely where Bob Pendleton wants
| to put it -- in a process which gets input from the user and feeds
| edited input to the user's other programs.  If needed, mods to the
| kernal and convention, however, should be made to make this as easy
| and efficient as possible.
+---------------

???  Why not just a modified version of gets()?  If you're running under
SVR3, you can build a new version of the shlib with the new gets() and
thereby upgrade every program on the system without recompiling!

(NOTE:  [1]  Using scanf() to do terminal input provides insufficient
	protection from erroneous input and insufficient user-friendliness;
	using a loop of getchar()'s is a bit weird.  I always use gets(),
	so all my programs would work first time.  Other programs?  Dunno,
	depends on how crazy the programmers were.
	[2]  It would, of course, distinguish between a terminal and a
	non-terminal (heck, stdio does this now), so gets() used in a filter
	wouldn't fry sort's (for example) little mind.)

I may actually try this, after backing up my system:  if it goes wrong I can
boot from the floppy and full-restore. . . .

++Brandon
-- 
Brandon S. Allbery, uunet!marque!ncoast!allbery			DELPHI: ALLBERY
	    For comp.sources.misc send mail to ncoast!sources-misc



More information about the Comp.unix.wizards mailing list