title: How to create a file if it does not exist otherwise clear an existing file?
body: <p>I have a project that opens a file and writes some information to it. The file needs to exist, and needs to be empty. The file needs to be created the first time the program is run, and the file needs to be cleared for each successive run.</p>
  
  <p>Is there an easy way in bash to create a file if it does not exist, else clear the contents of the existing file?</p>