Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watnot!watmath!clyde!rutgers!mit-eddie!bu-cs!bzs From: bzs@bu-cs.UUCP Newsgroups: comp.unix.questions,comp.unix.wizards,comp.lang.c Subject: Re: Filtering Everything Message-ID: <6447@bu-cs.BU.EDU> Date: Sun, 12-Apr-87 16:19:31 EST Article-I.D.: bu-cs.6447 Posted: Sun Apr 12 16:19:31 1987 Date-Received: Mon, 13-Apr-87 23:48:28 EST References: <919@watmum.UUCP> Distribution: comp Organization: Boston U. Comp. Sci. Lines: 18 Xref: utgpu comp.unix.questions:1689 comp.unix.wizards:1750 comp.lang.c:1574 In-reply-to: smvorkoetter@watmum.UUCP's message of 2 Apr 87 03:00:47 GMT Posting-Front-End: GNU Emacs 18.41.4 of Mon Mar 23 1987 on bu-cs (berkeley-unix) >I wish to write a program in C that I can somehow set up so all output >to my terminal goes through it first, and all input from my terminal goes >through it too. You don't say what version of UNIX (maybe I should teach an Emacs key to insert this at the top as a line eater giveaway :-) On 4.2/4.3 you want to do this via pty's. The script program is almost exactly what you want as a starting point (I don't know if you have access to sources.) Gnu Emacs is a program available publicly in source form which does this sort of thing (actually, if you run GNU emacs you could probably write this as an embedded lisp function, see terminal.el.) On SYSV I think you'll have difficulties doing what you say, especially for terminal oriented programs (you mention vi.) -Barry Shein, Boston University