title: change user to oracle and run sql in a shell script
body: <p>I am a root user and in a shell script I would like to change user to oracle than run a sql script, I tried following;</p>
  
  <pre><code>#!/bin/sh
  
  portStatus=`lsof -ni:5060`
  if [ ${#portStatus} -ne 0 ]
    then
      sudo -u oracle &lt;&lt; EOF
      /oracle/product/102/db/bin/sqlplus -s a513s6p4/a513s6p4 @/oracle/product/102/db/GW_EP_List.sql;
      EOF
    else
      exit
  fi
  </code></pre>
  
  <p>it gives me following error;</p>
  
  <pre><code>./deneme2.sh: syntax error at line 12: `end of file' unexpected
  </code></pre>
  
  <p>Can you please let me know what might be the problem?</p>
  
  <p>Thanks,
  Halit</p>