aboutsummaryrefslogtreecommitdiff
path: root/bin/clrd.sh
diff options
context:
space:
mode:
Diffstat (limited to 'bin/clrd.sh')
-rw-r--r--bin/clrd.sh15
1 files changed, 15 insertions, 0 deletions
diff --git a/bin/clrd.sh b/bin/clrd.sh
new file mode 100644
index 00000000..bf239033
--- /dev/null
+++ b/bin/clrd.sh
@@ -0,0 +1,15 @@
+# Clear the screen and read a file as it's written line-by-line
+self=clrd
+
+# Check we have an input file and are writing to a terminal
+if [ "$#" -ne 1 ] ; then
+ printf >&2 '%s: Need input file\n' "$self"
+ exit 2
+elif ! [ -t 1 ] ; then
+ printf >&2 '%s: stdout not a terminal\n' "$self"
+ exit 2
+fi
+
+# Clear the screen and start tailing out the file
+clear
+tail -f -- "$@"