title: Postgresql command execution in bash script
body: <p>I have written a shell script to execute postgresql commands . Problem is when I am executing this script it is showing an error :  <code>line 17: psql: command not found</code></p>
  
  <p>my script is as follows:</p>
  
  <pre><code>export PGPASSWORD=${PGPASSWORD-my_password}
  echo "enter host"
  read host
  echo "enter database name"
  read dbname
  echo "enter username"
  read username
  psql -h $host $dbname $username &lt;&lt;EOF
  SELECT * FROM test ; &gt;&gt;res.txt
  EOF
  
  ( cat res.txt) | sed 's/;/&lt;tab&gt;/g' &gt; $file.csv
  rm res.txt
  unset PGPASSWORD
  </code></pre>
  
  <p>Please suggest me what I am doing wrong .</p>