title: How to create a unix script to loop a Hive SELECT query by taking table names as input from a file?
body: <p>It's pretty straightforward what I'm trying to do. I just need to count the records in multiple Hive tables.</p>
  
  <p>I want to create a very simple <code>hql</code> script that takes a file.txt with table names as input and count the total number of records in each of them:</p>
  
  <pre><code>SELECT COUNT(*) from &lt;tablename&gt;
  </code></pre>
  
  <p>Output should be like:</p>
  
  <pre><code>table1 count1
  table2 count2
  table3 count3
  </code></pre>
  
  <p>I'm new to Hive and not very well versed in Unix scripting, and I'm unable to figure out how to create a script to perform this.</p>
  
  <p>Can someone please help me in doing this? Thanks in advance.</p>