title: How to pass date into shell script for a sqoop command dynamically?
body: <p>Im working on a sqoop import with the following command:</p>
  
  <pre><code>#!/bin/bash
      while IFS=":" read -r server dbname table; do
      sqoop eval --connect jdbc:mysql://$server/$dbname --username root --password cloudera --table mydata --hive-import --hive-table dynpart --check-column id --last-value $(hive -e "select max(id) from dynpart"); --hive-partition-key 'thisday' --hive-partition-value '01-01-2016'
  done&lt;tables.txt
  </code></pre>
  
  <p>Im doing the partition for everyday.
  Hive table:</p>
  
  <pre><code>create table dynpart(id int, name char(30), city char(30))
    partitioned by(thisday char(10))
    row format delimited
    fields terminated by ','
    stored as textfile
    location '/hive/mytables'
    tblproperties("comment"="partition column: thisday structure is dd-mm-yyyy");
  </code></pre>
  
  <p>But I don't want to give the partition value directly as I want to create a sqoop job and run it everyday. In the script, how can I pass the date value to sqoop command dynamically (format: dd/mm/yyyy) instead of giving it directly ?
  Any help is appreciated.</p>