Created
May 11, 2015 19:35
-
-
Save jlongman/276b106f1428013c2125 to your computer and use it in GitHub Desktop.
line looper
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# use line-lite.sh: https://brianin3d.wordpress.com/2008/05/14/scripting-with-ansi-color-codes/ | |
TMPFILE1=`mktemp /tmp/${tempfoo}.XXXXXX` || exit 1 | |
TMPFILE2=`mktemp /tmp/${tempfoo}.XXXXXX` || exit 1 | |
while `true`; do | |
COLS=`stty size | awk '{print $2}'` | |
eval "$@" > $TMPFILE1 | |
clear; | |
# diff -W$COLS -y $TMPFILE1 $TMPFILE2 | |
diff --left-column -W$COLS -y $TMPFILE1 $TMPFILE2 | ~/bin/line_lite.sh ".*|.*" bright ".*<.*" green ".*>.*" red | |
mv $TMPFILE1 $TMPFILE2 | |
sleep 2; | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment