ref: 369a574c8beeadf36720f23fc0b495cfc9300f8e
parent: 8d543ab105389199235e2e8a745b6dd0d7ceb663
author: qwx <qwx@sciops.net>
date: Sun Aug 22 19:47:18 EDT 2021
add holdchat: "safer" kvik chatcat but using hold(1)
--- /dev/null
+++ b/bin/holdchat
@@ -1,0 +1,18 @@
+#!/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
+while(){
+ hold /tmp/hold >[2]/dev/null \
+ && cat /tmp/hold | sed '1s/^/'$nick' → /' >>$cfile
+ && rm -f /tmp/hold
+ clr
+}