Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Posting-Version: version B 2.10.2 9/18/84 +SENDMAIL+2.11; site dcl-cs.UUCP
Path: utzoo!watmath!clyde!cbosgd!ihnp4!houxm!mhuxt!mhuxr!ulysses!allegra!mit-eddie!think!harvard!seismo!mcvax!ukc!icdoc!dcl-cs!john
From: john@dcl-cs.UUCP (John R Nicol)
Newsgroups: net.unix,net.unix-wizards
Subject: help needed with shell filter problem using pseudo ttys
Message-ID: <595@dcl-cs.UUCP>
Date: Tue, 24-Sep-85 12:11:49 EDT
Article-I.D.: dcl-cs.595
Posted: Tue Sep 24 12:11:49 1985
Date-Received: Sun, 29-Sep-85 04:20:13 EDT
Reply-To: john@dcl-cs.UUCP (John R Nicol)
Organization: Department of Computing at Lancaster University.
Lines: 25
Xref: watmath net.unix:5738 net.unix-wizards:15023
Xpath: icdoc ivax


     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.

     I opted for a solution based on pseudo-terminals,  i.e.
a  filter  process for input, one for output and a shell all
connected to a pseudo terminal.  The major  problem  encoun-
tered  is  that the input filter must know when it can build
up lines and when it must pass on RAW data.   It  must  then
know if the lines are input to the shell or to some tool, in
order to isolate genuine commands.

     Has anyone attempted anything similar?   Any  ideas  on
how to solve this problem?  I would be VERY GRATEFUL to hear
from anyone who can help.

     Thanks in advance!
-- 
UUCP:	...!seismo!mcvax!ukc!dcl-cs!john
DARPA:	john%lancs.comp@ucl-cs		    | Post: University of Lancaster,
JANET:	john@uk.ac.lancs.comp		    |	Department of Computing,
Phone:	+44 524 65201 Ext. 4146		    |	Bailrigg, Lancaster, UK.
Project:COSMOS Distributed Operating System |	LA1 4YR