From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from oldp.astro.wisc.edu ([128.104.39.15]) by hawkwind.utcs.toronto.edu with SMTP id <2645>; Fri, 4 Dec 1992 11:40:45 -0500 Received: by oldp.astro.wisc.edu (5.65/DEC-Ultrix/4.3) id AA06395; Fri, 4 Dec 1992 10:40:33 -0600 Message-Id: <9212041640.AA06395@oldp.astro.wisc.edu> To: sam-fans@hawkwind.utcs.toronto.edu Subject: Streaming sam. Date: Fri, 4 Dec 1992 11:40:32 -0500 From: Alan Watson X-Mts: smtp I have a recollection that a streaming version of sam a la sed is mentioned somewhere in the sam documentation, but I cannot find this reference now. Was this ever implemented, and what was it's syntax and semantics? I'm using the following (the error handling of which might be better), but I wonder if there is a precedent to follow. This version doesn't really stream in the sense that I am used to (meaning set up some commands and then stream the entire file past the commands), but it is more flexible. For example, to reverse a file one can use: ; ssam ',x m0' [1=2] Usage: ssam commands ... exit 1 } FIFO=/usr/tmp/ssam.$pid.rd mkfifo $FIFO { echo 'r '$FIFO while ( ! ~ $#* 0 ) { echo $1 shift } echo ',p' } | sam -d >[2=] & cat >$FIFO wait $apid rm -f $FIFO exit 0 # end-of-file