Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

recognise special characters ie $ sign

Status
Not open for further replies.

Scunningham99

Programmer
Sep 20, 2001
815
GB
Hi
How do I get script to recognise $ sign as a character in script. for example

select * from v$session;

I wish the dollar sign to be recognised. In solaris this would be done via v\$session. This does not seem to work ...
please advise



Sy UK
 
Sy, have you tried enclosing in quotes?

Alan Bennett said:
I don't mind people who aren't what they seem. I just wish they'd make their mind up.
 
By 'script' what do you mean? bash, ksh, perl?

Steve

[small]"Every program can be reduced by one instruction, and every program has at least one bug. Therefore, any program can be reduced to one instruction which doesn't work." (Object::perlDesignPatterns)[/small]
 
Been a while since I did any shell scripting, but try doubling the dollar sign
Code:
v$$session;

Steve

[small]"Every program can be reduced by one instruction, and every program has at least one bug. Therefore, any program can be reduced to one instruction which doesn't work." (Object::perlDesignPatterns)[/small]
 
Hi,

try this as root or connect as oracle and remove 1st and last lines :

Code:
su - oracle <<-!EORA
export TABLE='v\$session'
export CMD=$(basename $0 .ksh)
export ORACLE_SID=YOUR_INSTANCE
sqlplus system/your_manager <<-!EOSQL
spool /tmp/${CMD}_$$.sql.lst
select * from \$TABLE;
spool off
exit
!EOSQL
!EORA

Ali

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top