Shell Filter

COTTRELL, JAMES cottrell at NBS-VMS.ARPA
Thu Oct 17 05:12:59 AEST 1985


/*
> >     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 at nbs
*/
------



More information about the Comp.unix.wizards mailing list