Path: utzoo!utgpu!water!watmath!clyde!bellcore!rutgers!gatech!mandrill!hal!ncoast!allbery From: allbery@ncoast.UUCP (Brandon S. Allbery) Newsgroups: comp.unix.wizards Subject: Re: Input Line Editing Message-ID: <11933@ncoast.UUCP> Date: 22 Jul 88 23:18:33 GMT References: <16456@brl-adm.ARPA> <9666@eddie.MIT.EDU> Reply-To: allbery@ncoast.UUCP (Brandon S. Allbery) Followup-To: comp.unix.wizards Organization: Cleveland Public Access UN*X, Cleveland, Oh Lines: 35 As quoted from <9666@eddie.MIT.EDU> by nessus@wonko.MIT.EDU (Doug Alan): +--------------- | In article <16456@brl-adm.ARPA> rbj@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