Linux Operating System (MOSC)

MOSC Banner

pass variables to shell script then to SQL script

edited May 19, 2016 11:58PM in Linux Operating System (MOSC) 2 commentsAnswered ✓

Hi all,

I am trying to pass variables multiple times. I need to use them in a shell script then use them in an SQL script. This is OL6.7 and 11.2.0.4 if it makes a difference.

Here is an example;

shell.sh DBNAME1 DBNAME2

export TARGET=DBNAME1

export AUX=DBNAME2

This part works, no problem.

I also want to pass one of these to a SQL script called similarly in the shell script;

$ORACLE_HOME/bin/sqlplus "/ as sysdba" @global_name.sql $AUX  ???

I don't know how to do this part. All examples I see pass an actual value, something like this;

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center