Ian Ward's email:
first name at this domain
wardi on OFTC, freenode and github
watch(1) is a very useful little tool when you want to see the results of a command changing over time.
Unfortunately it seems that it doesn't support Unicode or colours in its output. This is a short bash function that does much of what watch can do, but with no trouble handling Unicode or coloured output.
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') | tac | tac
sleep 2
done
}
This bash function ("botch" because it rhymes with "watch") executes the command passed every two seconds and displays its output without clearing the screen, so as long as the output is not longer than the screen there will be no flicker. The \033[H escape sequence moves to home position (top-left), \033[0K erases to the end of the line and \033[J clears to the bottom of the screen. tac | tac buffers the output until the command is finished.
Examples:
botch ls --color
botch unicode '${RANDOM:1}'