title: How to return a value from psql to bash and use it?
body: <p>Suppose I created a sequence in postgresql:</p>
  
  <pre><code>CREATE SEQUENCE my_seq;
  </code></pre>
  
  <p>I store the below line in an sql file get_seq.sql</p>
  
  <pre><code>SELECT last_value FROM my_seq;
  
  $SUDO psql -q -d database_bame -f get_seq.sql
  </code></pre>
  
  <p>How do I get the int number returned by SELECT into bash and use it?</p>