title: Modify oracle sql query output format
body: <p>I want to change output format of my oracle sql script.
  Consider I have a script named: active_user.sh which inside it I just write my query. Now the problem is when I bash the script the output displayed without caption and only values are shown.</p>
  
  <p><em><strong>The script is:</em></strong></p>
  
  <pre><code>export CONNECT_STRING=$1
  if [ x$2 == x ]
  then echo First Parameter is connection string to DB and Second parameter have to be ORACLE_HOME variable &amp;&amp; exit 1
  else export ORACLE_HOME=$2
  fi
  export ORACLE_SID=OMEGA #fake
  export PATH=$ORACLE_HOME/bin:$PATH
  RAND=$$
  sqlplus -s /nolog &lt;&lt;-EOF &gt; /tmp/${RAND}.sql_out.temp
  
  connect $CONNECT_STRING
  set HEADING OFF
  set PAGESIZE 0
  set linesize 120
  col metric_name format a40
  col value format 999999990.9999
  select count(*) from v\$session where username is not null  and status='ACTIVE';
  EOF
  
  cat /tmp/${RAND}.sql_out.temp
  </code></pre>
  
  <p><em><strong>And this is the command to run the script and the output is:</em></strong></p>
  
  <pre><code>[root@oracle-test scripts]# ./active_users.sh "ora/orapass123@mydb" /opt/oracle/instantclient_11_2
           1
  
      23.0000
  </code></pre>
  
  <p><em><strong>But when I run the query in sqlplus it returns something like this:</em></strong></p>
  
  <pre><code>COUNT(*)
  ----------
  1
  </code></pre>