The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Google UNIX.COM


Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
search excat string in another string (grep "fails") bora99 UNIX for Dummies Questions & Answers 0 06-05-2008 03:41 AM
How to include RETURN KEY with Background process "&" in Shell Script racbern Shell Programming and Scripting 1 03-11-2008 04:30 AM
"include" directory is not there Katkota UNIX for Dummies Questions & Answers 10 01-01-2008 09:07 PM
Explain the line "mn_code=`env|grep "..mn"|awk -F"=" '{print $2}'`" Lokesha UNIX for Dummies Questions & Answers 4 12-19-2007 10:52 PM
how to include slashes "/" in @ARGV (Perl) umen Shell Programming and Scripting 3 01-30-2006 08:21 PM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 06-07-2006
Registered User
 

Join Date: Jul 2004
Location: New York State
Posts: 65
How do I include "$" in a string

I have the following code.

Code:
sqlString="CREATE USER $1 IDENTIFIED BY $3
           DEFAULT TABLESPACE TEMPTABS
           TEMPORARY TABLESPACE TEMPSEGS
           QUOTA UNLIMITED ON TEMPTABS
           PROFILE DEFAULT
           ACCOUNT UNLOCK;

           GRANT xxxxxx_ROLE TO $1;
           ALTER USER $1 DEFAULT ROLE xxxxxx_ROLE;

           CREATE USER $2 IDENTIFIED EXTERNALLY
           DEFAULT TABLESPACE TEMPTABS
           TEMPORARY TABLESPACE TEMPSEGS
           QUOTA UNLIMITED ON TEMPTABS
           PROFILE DEFAULT
           ACCOUNT UNLOCK;

           GRANT xxxxxx_ROLE TO $2;
           GRANT yyyyyy_ROLE TO $2;
           ALTER USER $2 DEFAULT ROLE xxxxxx_ROLE,yyyyyy_ROLE;
           
           exit;"

           echo "$sqlString" > $APP_HOME/test/EMPMC.$$

sqlplus system/xxxxx @$APP_HOME/test/EMPMC.$$

rm $APP_HOME/test/EMPMC.$$
when I invoke the script test.sh APPLE OPS$APPLE PEAR

I get an error message that the APPLE variable is not defined. How do I pass the argument without unix interperting the "$APPLE" as a variable.

Any help would be appreciated. I should know this, but it has been a while since I did scripting.
Reply With Quote
Forum Sponsor
  #2  
Old 06-07-2006
Registered User
 

Join Date: Jan 2005
Posts: 682
try OPS\$APPLE
Reply With Quote
  #3  
Old 06-08-2006
Registered User
 

Join Date: Jul 2004
Location: New York State
Posts: 65
Thank you very much. That fixed the problem.

Last edited by beilstwh; 06-08-2006 at 06:05 AM.
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 11:53 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0