shithub: snippets

Download patch

ref: 53712a22e4b67d805c888a08f4586067c047bf62
parent: 1f4f888404943771791d9433de9be98ad30577fb
author: Sigrid Solveig Haflínudóttir <ftrvxmtrx@gmail.com>
date: Sat Jan 16 18:09:15 EST 2021

add clear

--- a/README.md
+++ b/README.md
@@ -11,4 +11,5 @@
 * `qt.[ch]` [QP tries](https://dotat.at/prog/qp/README.html)
 * `xml.[ch]` XML parser, works as a streaming parser as well
 
+* `clear` removes all program output from the terminal, leaving only commands used
 * `watch` watch-like tool, imagine
--- /dev/null
+++ b/clear
@@ -1,0 +1,10 @@
+#!/bin/rc
+# clears all the output from programs,
+# leaving only the command prompts
+
+grep `{echo -n '^'^$prompt(1)} </dev/text | \
+	grep -v '^'^$prompt(1)^clear | \
+	uniq >/tmp/clearing.$pid
+
+cp /tmp/clearing.$pid /dev/text
+rm -f /tmp/clearing.$pid