Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site brl-tgr.ARPA Path: utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!think!harvard!seismo!brl-tgr!tgr!cottrell@NBS-VMS.ARPA From: cottrell@NBS-VMS.ARPA (COTTRELL, JAMES) Newsgroups: net.unix-wizards Subject: Shell Filter Message-ID: <2197@brl-tgr.ARPA> Date: Wed, 16-Oct-85 15:12:59 EDT Article-I.D.: brl-tgr.2197 Posted: Wed Oct 16 15:12:59 1985 Date-Received: Fri, 18-Oct-85 01:25:23 EDT Sender: news@brl-tgr.ARPA Lines: 36 /* > > I am trying to write a filter for the shell. The idea > >is to trap commands and carry out certain actions before > >passing a possibly modified command on to the shell. This > >seemingly simple task is proving rather difficult. > > Your idea for using ptty's seems sound. I have done much the same > using named pipes on sysV. For the filter, I would try it using m4, > or awk if your processing is complicated. There are only a couple > cases where you would have to turn off pre-processing to send raw > data to a program, such as a hereis (<<) document or quoted strings. > In awk, you could implement that by setting a flag when those > structures are encountered. Try hacking on script. We have a terminal here that xmt's upper case when unshifted, lower case when shifted. You heard me right. The first thing I did was flip the case on all incoming alfa's. The damn thing also uses ^Z for backspace instead of ^H, which is hardwired into the tty driver, so I change ^H to ^Z. But wait! Cursor addressing is ^C, Y, X, where X & Y are unbiased! So I have to have a state machine allowing the next two chars literally. There's more. It seems that stty nl[1-3] cr[1-3] don't send nulls, so I have to do my own padding. Etcetera... There is no reason why you couldn't do history or anything else you wanted to do here as well. My own question: I would like to put my VT220 to work in VT220 mode instead of running it in VT100 mode. Unfortunately it believes in the parity bit & goes into weird character set mode. Is there any way to force the parity bit always off under BSD4.2? If not, I'll have to hack script again..... jim cottrell@nbs */ ------