peledc
asked on
ssh with special character to sqlplus
Hi,
In Linux RHEL 5.6
I'm trying to execute a SQL statement inside Oracle on a remote host.
My query is using the v$parameter and I'm having problems passing the $(dollar sign).
My code:
> RESULT=`ssh 10.0.0.3 "setenv ORACLE_SID $PRIMARY_ORACLE_SID; sqlplus -s / as sysdba << EOF
select value from v$parameter where name='dg_broker_start';
EOF"`
> echo RESULT=$RESULT
RESULT= select value from v where name='dg_broker_start'
I tried "v$parameter"
and v\$parameter
and "v\$parameter"
none of the above worked.
Only the V is left...
In Linux RHEL 5.6
I'm trying to execute a SQL statement inside Oracle on a remote host.
My query is using the v$parameter and I'm having problems passing the $(dollar sign).
My code:
> RESULT=`ssh 10.0.0.3 "setenv ORACLE_SID $PRIMARY_ORACLE_SID; sqlplus -s / as sysdba << EOF
select value from v$parameter where name='dg_broker_start';
EOF"`
> echo RESULT=$RESULT
RESULT= select value from v where name='dg_broker_start'
I tried "v$parameter"
and v\$parameter
and "v\$parameter"
none of the above worked.
Only the V is left...
if I'm not mistaken, you may have to use v\\\$
the first will be drawn down to v\$
If this is a common query, why not setup a script on the remote end to which you will be passing data points?
the first will be drawn down to v\$
If this is a common query, why not setup a script on the remote end to which you will be passing data points?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
You could also try 1 (or 3) backslashes between the << and the EOF (immediately before the E of EOF).
ASKER
This worked \\\\\\
Thanks...
Thanks...
If two backslasehs don't work either try three of them (at least I once had to do so to make it work).