summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonas Smedegaard <dr@jones.dk>2006-12-02 17:18:30 +0000
committerJonas Smedegaard <dr@jones.dk>2006-12-02 17:18:30 +0000
commit661f3bbcffa943757aa3edceca0907df86cc71ca (patch)
tree659724cb8770e0f9a7232b62a74be6ee81d329c1
parenta15ef1c30c080f62f2646aaffcb5e4310354f149 (diff)
Run a command each second and dump output to the terminal screen.
-rwxr-xr-xlocalloopdump20
1 files changed, 20 insertions, 0 deletions
diff --git a/localloopdump b/localloopdump
new file mode 100755
index 0000000..1de4054
--- /dev/null
+++ b/localloopdump
@@ -0,0 +1,20 @@
+#!/bin/sh
+#
+# /usr/local/bin/localloopdump
+# Copyright 2006 Jonas Smedegaard <dr@jones.dk>
+#
+# $Id: localloopdump,v 1.1 2006-12-02 17:18:30 jonas Exp $
+#
+# Endlessly loop of exec'ing a command and dumping its output to stdout
+#
+# TODO: Use getopts to make slepp time customizable
+#
+
+set -e
+
+while test 1 = 1; do
+ output=$("$@")
+ clear
+ echo -n "$output"
+ sleep 1
+done