How To Clear The Screen If A Script Is Being Run Interactive

Introduction

The following piece of code is used to clear the terminal screen when a script is being run interactively. This piece of code is call be scripts on this site to make the output more readable.

Code

#
#Clear screen if tty
#

if [ -t -eq 0 ];then
  clear
fi
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License