From: Alan Watson <alan@oldp.astro.wisc.edu>
To: sam-fans@hawkwind.utcs.toronto.edu
Subject: Streaming sam.
Date: Fri, 4 Dec 1992 11:40:32 -0500 [thread overview]
Message-ID: <9212041640.AA06395@oldp.astro.wisc.edu> (raw)
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' <foo
Alan.
; cat $home/bin/ssam
#! /usr/users/alan/bin/rc
if ( ~ $#* 0) {
echo >[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
next reply other threads:[~1992-12-04 16:40 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
1992-12-04 16:40 Alan Watson [this message]
1992-12-04 16:44 Alan Watson
1992-12-04 17:57 Alan Watson
1992-12-04 19:10 Byron Rakitzis
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=9212041640.AA06395@oldp.astro.wisc.edu \
--to=alan@oldp.astro.wisc.edu \
--cc=sam-fans@hawkwind.utcs.toronto.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).