Path: utzoo!news-server.csri.toronto.edu!cs.utexas.edu!usc!samsung!uunet!mcsun!hp4nl!phigate!philica!lex From: lex@philica.ica.philips.nl (Lex van Sonderen) Newsgroups: comp.windows.news Subject: wanted: pipe operator example Message-ID: <755@philica.ica.philips.nl> Date: 6 Mar 91 15:44:40 GMT References: <1991Mar5.024148.18582@quorum.com> Reply-To: lex@leest.ica.philips.nl (Lex van Sonderen) Organization: Philips TDS, Innovation Centre Aachen Lines: 26 I want to use the pipe operator to open a shell, send a command, read the result, send a command, read the result etc... I do something like this: /trypipe { % -- -> -- (/bin/sh) pipe % readfile writefile dup (pwd) writestring % readfile writefile dup flushfile % readfile writefile 1 index 100 string readstring { % readfile writefile str == % readfile writefile } { pop (nothing\n) == % readfile writefile } ifelse % now write some more commands % .... pop pop % -- } def Apparently, the operator gets stuck in readstring, no error messages. Closing the writefile before reading the readfile does help, but I want to keep it open. Help! Lex van Sonderen lex@ica.philips.nl