1752806 Members
5795 Online
108789 Solutions
New Discussion юеВ

Extra space in sqlplus

 
SOLVED
Go to solution
wojtek75
Frequent Advisor

Extra space in sqlplus

Hi,

====
#!/bin/ksh

a=$(echo "set heading off\nselect status from v\$instance;"| sqlplus -s '/as sysdba')

print =$a=
===
and I get (please note a leading space):
= OPEN=

Can anybody tell me where this space come from? How to return the value without the space? I am not interested in external space removers (tr,sed,awk etc).
6 REPLIES 6
Dennis Handly
Acclaimed Contributor

Re: Extra space in sqlplus

>Can anybody tell me where this space come from?

From your external sqlplus.

>I am not interested in external space removers

Why not? Do you want a shell builtin?
a=${a## }
wojtek75
Frequent Advisor

Re: Extra space in sqlplus

Why sqlplus returns an extra space? How to avoid it?

I think a=${a##} doesn't work in my ksh Version M-11/16/88f.
Dennis Handly
Acclaimed Contributor

Re: Extra space in sqlplus

>I think a=${a##} doesn't work in my ksh

Did you cut&paste my text, you lost the space.
wojtek75
Frequent Advisor

Re: Extra space in sqlplus

You are correct, ## works fine. But still interested in why sqlplus returns extra space in fron of its output.
Jean-Luc Oudart
Honored Contributor
Solution

Re: Extra space in sqlplus

could you add the sqlplus command :
set newpage none

Regards
Jean-Luc
fiat lux
wojtek75
Frequent Advisor

Re: Extra space in sqlplus

this is exactly what I was looking for, thanks!