#!/bin/rc if(~ $#* 0){ addr='tcp!localhost!44322' } if not if(! ~ $#* 1){ echo 'usage: 9talk/log [addr]' >[1=2] exit usage } if not addr=$"1 buffile=.ncbuf$pid fn onecmd{ cmd=$"* {echo $"cmd; echo QUIT} | aux/dial -e $addr } fn linecmd{ onecmd $"* >$buffile count=`{read -n 1 $buffile} msgid=`{tail -1 $buffile} if(! ~ 0 $count) tail +2 $buffile | read -n $count rm $buffile } linecmd LAST 16 while(){ sleep 5 linecmd SKIP $msgid }