title: Hive - How to store a query result in a variable in a Bash script
body: <p>I need to store the result of a Hive query in a variable whose value will be used later. So, something like:</p>
  
  <pre><code>$var = select col1 from table;
  
  $var_to_used_later = $var;
  </code></pre>
  
  <p>All this is part of a bash shell script. How to form the query so as to get the desired result?</p>