#!/bin/bash function sigwinch { clear WIDTH=$(stty size | cut '-d ' -f2) } trap sigwinch WINCH sigwinch if [ "_$DELAY" = "_" ];then DELAY=1 fi while true;do echo -ne "\x1b[7m" #reverse colors echo "running $* @ $(date)" | pad $WIDTH echo -ne "\e[0m" #reset colors $* | pad sleep $DELAY echo -ne "\x1b[H" done