Skip to content

Instantly share code, notes, and snippets.

@micc83
Created December 20, 2018 08:51
Show Gist options
  • Save micc83/0d9d563eb7139648fac63444acf077ca to your computer and use it in GitHub Desktop.
Save micc83/0d9d563eb7139648fac63444acf077ca to your computer and use it in GitHub Desktop.
Tail for commands on Mac
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