Created
December 20, 2018 08:51
-
-
Save micc83/0d9d563eb7139648fac63444acf077ca to your computer and use it in GitHub Desktop.
Tail for commands on Mac
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
botch() { | |
while true; do | |
(echo -en '\033[H' | |
CMD="$@" | |
bash -c "$CMD" | while read LINE; do | |
echo -n "$LINE" | |
echo -e '\033[0K' | |
done | |
echo -en '\033[J') | tail -r | tail -r | |
sleep 2 | |
done | |
} | |
# On linux can use tac instead of tail -r | |
# source: http://excess.org/article/2009/07/watch1-bash-unicode/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment