title: how to test whether hdfs file exists using Bash
body: <p>I want to write a Bash script to check whether (or not) a file exists in a certain location.  I have a couple of variables I am using and so far have this working:</p>
  
  <pre><code>if hdfs dfs -test -e $NIFI/cust_accounts/$CURRPART; then echo $NIFI/cust_accounts/$CURRPART partition is current on HDFS; fi
  </code></pre>
  
  <p>However, I really want to be able to return an "else" statement.  Meaning
  "if file exists then 123 else (if does not exist) 999".</p>
  
  <p>Can someone help me construct an "else" statement?  Thank you!</p>