shithub: rc

ref: 05158bda287766580ed5e8e3416d0046678c7d3b
dir: /bin/holdchat/

View raw version
#!/bin/rc
rfork ne
flagfmt='f chatfile, n nick'
args=''
if(! eval `''{aux/getflags $*} || ! ~ $#* 0)
	exec aux/usage
cfile=/n/chat/chat
nick=qwx
if(~ $#flagf 1)
	cfile=$flagf
if(~ $#flagn 1)
	nick=$flagn
echo no. >[1=2]; exit no.
while(){
	hold /tmp/hold >[2]/dev/null \
	&& cat /tmp/hold | sed '1s/^/'$nick' → /' >>$cfile
	&& rm -f /tmp/hold
	clr
}