Subject: Re: ssam, again

From: "James A. Robinson" <[email-masked]>
Date: Wed, 1 Mar 2000 11:17:51 -0500

> There has been previous incarnations of a stream version of sam. I have
> used one by Alistair Crooks [email-masked]. Here is a new one,
> implemented as a rc script using sam -d. Since the fans email list is
> low volume I hope that you will all survive that I email b oth the script
> and the man page in seperate emails :-)
> 
> I have thought about including this script with sam-9libs. Is it
> sufficiently useful, or does it detract so much from sam that it
> should be kept hidden?

It's always nice to see useful wily scripts.  I don't know if I 
ever posted or sent this one out, but I have a copy of a sam
script someone posted to sam-fans ages ago. It is neat in that
it uses a FIFO instead of a temporary file. It is no where near
as flexibly as what you posted, but I thought you might be
interested...

#!/opt/plan9/bin/rc

umask 077

if ( ~ $#* 0) {
  echo >[1=2] Usage: wsam commands ...
  builtin exit 1
}

if ( test -d /usr/tmp ) {
	tmp_dir=/usr/tmp
} else if ( test -d /var/tmp ) {
	tmp_dir=/var/tmp
} else if ( test -d /tmp ) {
	tmp_dir=/tmp
} else if ( test -d $HOME ) {
	tmp_dir=$HOME
} else {
	echo >[1=2] wsam: I cannot find a nice place to put my FIFO
	builtin exit 1
}

FIFO=$tmp_dir^'/'^wsam.$pid.rd
mkfifo -m 0700 $FIFO
{
  echo 'r '$FIFO
  while ( ! ~ $#* 0 ) {
    echo $1
    shift
  }
  echo ',p'
} | sam -d >[2=] &

cat >$FIFO

wait $apid

rm -f $FIFO

builtin exit 0
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
James A. Robinson                       [email-masked]
Stanford University HighWire Press      http://highwire.stanford.edu/
650-723-7294 (W) 650-725-9335 (F)

---

From: Bengt Kleberg <[email-masked]>
Date: Wed, 1 Mar 2000 10:04:05 -0500

There has been previous incarnations of a stream version of sam. I have used one by Alistair Crooks
[email-masked]. Here is a new one, implemented as a rc script using sam -d. Since the
fans email list is low volume I hope that you will all survive that I email both the script and the man page
in seperate emails :-)

I have thought about including this script with sam-9libs. Is it sufficiently useful, or does it detract
so much from sam that it should be kept hidden?

Best Wishes, Bengt
===============================================================
Everything aforementioned should be regarded as totally private
opinions, and nothing else. [email-masked]
``His great strength is that he is uncompromising. It would make
him physically ill to think of programming in C++.''