ksh variable substitution
I am trying to write a ksh script that will generate commands. I will be passing variables to the script of the script will read lines from a file. I then want to substitute these variables into a command which I run with ``. First of all can variables be substituted into a line being executed with `` surrounding it. I cannot easily tell. Here is a piece of the code. I echo it first (substitutions are made here).
echo rman target / restore controlfile to $DATAGROUP2 from $line
rman target / restore controlfile to +DATAGROUP1 from /u12/oracle/EBSSTAGE/db/apps_st/data/cntrl03.dbf
Then I run the command
var1=`rman target / restore controlfile to $DATAGROUP2 from $line;`