summaryrefslogtreecommitdiff
path: root/nocompile
diff options
context:
space:
mode:
authorepochqwert <epoch@hacking.allowed.org>2015-06-28 00:19:50 -0500
committerepochqwert <epoch@hacking.allowed.org>2015-06-28 00:19:50 -0500
commit75f05369650cc05002b9c131a8453714dcf14dde (patch)
tree6e8136685772dadd0239d5bbb61a377bbd457ff6 /nocompile
parent976c801cbe9ae8d03cae529b57a10cbb588fd92a (diff)
downloadmisc-75f05369650cc05002b9c131a8453714dcf14dde.tar.gz
misc-75f05369650cc05002b9c131a8453714dcf14dde.zip
fixed watch to not need bash
Diffstat (limited to 'nocompile')
-rwxr-xr-xnocompile/bin/watch10
1 files changed, 5 insertions, 5 deletions
diff --git a/nocompile/bin/watch b/nocompile/bin/watch
index d9a6328..ccd94b3 100755
--- a/nocompile/bin/watch
+++ b/nocompile/bin/watch
@@ -1,5 +1,5 @@
-#!/bin/bash
-function sigwinch {
+#!/bin/sh
+sigwinch() {
clear
WIDTH=$(stty size | cut '-d ' -f2)
}
@@ -9,10 +9,10 @@ if [ "_$DELAY" = "_" ];then
DELAY=1
fi
while true;do
- echo -ne "\x1b[7m" #reverse colors
+ printf "\x1b[7m" #reverse colors
echo "running $* @ $(date)" | pad $WIDTH
- echo -ne "\e[0m" #reset colors
+ printf "\e[0m" #reset colors
$* | pad
sleep $DELAY
- echo -ne "\x1b[H"
+ printf "\x1b[H"
done