0
#!/bin/bash -x

x=`sqlplus scott/tiger@xe<<endl
set heading off
select sysdate from dual;
exit
endl`

echo the answer is $x

is outputting

the answer is SQL*Plus: Release 10.2.0.1.0 - Production on Wed Mar 27 09:01:25 2013 Copyright (c) 1982, 2005, Oracle. All rights reserved. Connected to: Oracle Database 10g Express Edition Release 10.2.0.1.0 - Production SQL> SQL> 27-MAR-13 SQL> Disconnected from Oracle Database 10g Express Edition Release 10.2.0.1.0 - Productiong 

All I want is the result of the query sysdate. How do I get rid of all the oracle relase, copyright, ... info.

1 Answer 1

0

I found the answer

sqlplus -s

will then eliminate the headers

Sign up to request clarification or add additional context in comments.

1 Comment

The parameter "-s" its only to connect to DB in silent mode.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.