summaryrefslogtreecommitdiff
path: root/nocompile/bin/watch
diff options
context:
space:
mode:
Diffstat (limited to 'nocompile/bin/watch')
-rwxr-xr-xnocompile/bin/watch18
1 files changed, 18 insertions, 0 deletions
diff --git a/nocompile/bin/watch b/nocompile/bin/watch
new file mode 100755
index 0000000..d9a6328
--- /dev/null
+++ b/nocompile/bin/watch
@@ -0,0 +1,18 @@
+#!/bin/bash
+function sigwinch {
+ clear
+ WIDTH=$(stty size | cut '-d ' -f2)
+}
+trap sigwinch WINCH
+sigwinch
+if [ "_$DELAY" = "_" ];then
+ DELAY=1
+fi
+while true;do
+ echo -ne "\x1b[7m" #reverse colors
+ echo "running $* @ $(date)" | pad $WIDTH
+ echo -ne "\e[0m" #reset colors
+ $* | pad
+ sleep $DELAY
+ echo -ne "\x1b[H"
+done