title: check if file exist in hdfs with wildcard character
body: <p>I want to check if a file exist in hdfs or not. I am using </p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>if $(hadoop fs -test -e $myfilewithpath) ; then echo "ok";else echo "not ok"; fi</code></pre>
  </div>
  </div>
  </p>
  
  <p>Now I am getting an error message like </p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>test: `/data/bi/udm/incoming/Viewership/year=2016/month=02/day=26/hour=07/part-m-*.avro': No such file or directory
  not ok</code></pre>
  </div>
  </div>
  </p>
  
  <p>The file which I am expecting in the path can be any mapper output file i.e. it can be <code>part-m-00000.avro</code> or it can be <code>part-m-00099.avro</code> and that is why I am using <code>*</code> in my search like <code>part-m-*.avro</code>.</p>
  
  <p>But can we eliminate the below message and get only output as <code>not ok</code></p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>test: `/data/bi/udm/incoming/Viewership/year=2016/month=02/day=26/hour=07/part-m-*.avro': No such file or directory</code></pre>
  </div>
  </div>
  </p>