I have a .sh file which acts as an all set for a couple of oracle scripts i want to call. Basically it has 3 variables, the user Id, the password, and the oracle instance to connect to.. the problem is I cant seem to get the connection string format properly.. the program essentially is this:
-----------------------
SYSTEM_UID=SYSTEM
SYSTEM_PWD=SYSTEM
DATABASE=myDatabase
CREATEUSERCMD="sqlplus ${SYSTEM_UID}/${SYSTEM_PWD}@${DATABASE}"
echo Printing user Id: ${SYSTEM_UID}
echo Printing pwd: ${SYSTEM_PWD}
echo Printing db: ${DATABASE}
echo Printing connection string: ${CREATEUSERCMD}
----------------------------
Resulting output I get is:
$ bash allset.sh
Printing user Id: SYSTEM
Printing pwd: SYSTEM
Printing db: myDatabase
@myDatabasennection string: sqlplus SYSTEM
Am I resolving those slashes and ampersands incorrectly? Or is there an issue with the way I'm referencing those variables? If I hard code the connection string as:
CREATEUSERCMD='sqlplus SYSTEM/SYSTEM@myDatabase'
and then just call : ${CREATEUSERCMD} it works fine.