title: Fabric check to see file has data
body: <p>I want to check whether a file has data inside it, if it has show me what's inside that file, if not exit with "Nothing in the file".  I am using Fabric 1.2 to do this on a remote server. </p>
  
  <p>I am trying this:</p>
  
  <pre><code>    def test():
          run("cat myfile.txt | awk '{print $1}' &gt; /dir/newfile.txt")
      if run("test -s /dir/newfile.txt || cat /dir/newfile.txt"):
              else run("echo Nothing in the file")
  </code></pre>
  
  <p>I know this is not the best way of doing this and I know Python uses os.path.getsize(path) for similar purposes.  Can you help at all? </p>