cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Shilpa_Mittal
Level 2

How to use variables in script

Hi,

I am new to install anywhere.I want to use value of USER_INSTALL_DIR in my batch script file.I tried using "Set Install any where variable" by assigning it's value to a variable e.g PARAM1 and then using that variable $PARAM1 in my csh script.

However while running script ,it gives unknown variable PARAM1 .Can anyone help me how to use variable in my script?


Shilpa
Labels (1)
0 Kudos
(4) Replies
pv7721
Level 20

Would it be possible to post your script?
0 Kudos
macd81o0
Level 3

I'm having the same problem. How do you use an IA variable in a batch script? Do you just have to use $VAR_NAME$?

In the script I'm trying to pass an IA variable into a java class.

java -cp $CLASSPATH className $VAR_NAME$

Are there any problems doing this?
0 Kudos
Shilpa_Mittal
Level 2

Hi Vlad,

The script is very simple .I just want to run a procedure from the $USER_INSTALL_DIR.

I have assigned $USER_INSTALL_DIR$ to INSTALL_DIR using Set Install where variable-Single Variable as given:
variable name :INSTALL_DIR
set value to :$USER_INSTALL_DIR$

and the script is


#!/bin/csh
echo $INSTALL_DIR$ >> test.txt
sqlplus -s nx/abc<< EOF
@CUSTOMER_PROCEDURES.sql;
exit
EOF

Regards
Shilpa
0 Kudos
pv7721
Level 20

You've got two option. You either use the Execute Script/Batch file and you paste the contents of your script there, and the $USER_INSTALL_DIR$ variable will be automatically replaced, or you can install your script file and before executing it, you use the Modify Text File - Single File, where you check the option Substitute InstallAnywhere variables in file.
0 Kudos