#!/bin/bash ## clearline, a line clearing terminal utility, moves cursor upwards ## n lines, overwriting each line, in turn, with blank spaces. ## ## Usage: clearline [n] (Default: n=0) n=$(($1+1)) ## Add 1 to compensate for newline from command entry. for ((n; n>0; n-- )) ## For each of 'n' itterations: do tput cuu1 ## Move cursor to first column of line above. tput el ## Clear to end of line. done