From 976c801cbe9ae8d03cae529b57a10cbb588fd92a Mon Sep 17 00:00:00 2001 From: epochqwert Date: Sun, 28 Jun 2015 00:15:29 -0500 Subject: fixed up a lot of warnings. added watch. --- nocompile/bin/watch | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100755 nocompile/bin/watch (limited to 'nocompile/bin') 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 -- cgit v1.2.3