title: Pass date from shell script to query
body: <p>Below is my shell script from which I am running my Hive query. In this I am calculating the Yesterday's date and I am passing that Yesterday's date in the where clause. But that query is not working for me.</p>
  
  <pre><code>#!/bin/bash
  DATE_YEST=`TZ=GMT+48 date +%Y%m%d`
  echo $DATE_YEST
  hive -S -e 'SELECT * FROM PDS_ATTRIBUTE_DATA_REALTIME WHERE dt=$DATE_YEST'
  </code></pre>
  
  <p>I am running the above script like this-</p>
  
  <pre><code>sh -x test.sh
  </code></pre>
  
  <p>Is there something wrong with the way I am passing that <code>DATE_YEST date</code> in the where clause?</p>