shell filter

David A. Tristram dat at AMES-NAS.ARPA
Wed Oct 2 07:23:13 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.

Tristram

----------



------- End of Forwarded Message

----------



More information about the Comp.unix.wizards mailing list