LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 01-11-2007, 09:39 AM   #1
cleopard
Member
 
Registered: May 2006
Posts: 39

Rep: Reputation: 15
Unhappy Linux script using Oracle; special character


I'm in the midst of moving scripts from a UNIX environment to Linux. A lot of the scripts use Oracle and do a connect inside the script. There are some user names on our Oracle databases that have a '$' within it (such as 'ops$username'). It seems to cause a problem when there's a line in the script like:

$ORACLE_PATH/sqlplus ops\$username/password@db_name.com @/apps/script.sql

Even using the backslash before the dollar sign doesn't seem to solve the problem; I tried putting double-quotes around the username/password, but that didn't help either. I can logon with this username/password using PL/SQL Developer, as well as on the command line in Linux.

Thanks for any ideas or pointers.
 
Old 01-11-2007, 10:35 AM   #2
anomie
Senior Member
 
Registered: Nov 2004
Location: Texas
Distribution: RHEL, Scientific Linux, Debian, Fedora
Posts: 3,935
Blog Entries: 5

Rep: Reputation: Disabled
Try single-quotes ('$username'). That should prevent parameter expansion.
 
Old 01-11-2007, 11:10 AM   #3
cleopard
Member
 
Registered: May 2006
Posts: 39

Original Poster
Rep: Reputation: 15
clarification

Well, the problem is the dollar sign character in the username, i.e. ops$username , and how Linux interprets it. I tried:

$ORACLE_PATH/sqlplus 'ops$username/password@dbname.com' @sqlfile.sql

with and without a backslash in front of the dollar sign and I still got:

SQL*Plus: Release 9.2.0.6.0 - Production on Thu Jan 11 11:01:01 2007

Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.

ERROR:
ORA-12545: Connect failed because target host or object does not exist


after I ran the script (via a cron job). It's got to be because it's misinterpreting the dollar sign, since I can logon to that account on the command line as well as PL/SQL Developer.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
block special and character special files s_shenbaga Linux - Newbie 4 06-23-2015 02:16 AM
Inserting a special character with the keyboard #2 Schreiberling Linux - General 1 06-11-2006 03:57 PM
special character boolim Linux - General 1 08-29-2003 09:57 AM
how to echo special character question ArnaudVR Linux - Software 1 06-29-2003 11:11 AM
i need help with a special character Hone101 Linux - Newbie 1 05-03-2003 07:21 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 10:42 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration