So, are you saying that you have
$a set as
DML_FILE_NAME_ORIG1=$INF_COMRCLDATAMART_DML/ft_arnge_cred_risk_mtgt_fact.dml then?
This will not work. You are asking the shell to work with a file that isn't one. Which is the file you actually want to work with? I presume it's the one referred to by
DML_FILE_NAME_ORIG1, i.e.
$INF_COMRCLDATAMART_DML/ft_arnge_cred_risk_mtgt_fact.dml
This far down the chain of variables, the
$ will just be a character. You need to get that interpreted before you call the
cp command.
I would suggest that your logic is over complicated. Break it down to find a simpler way to refer to the file you need. If not, you will end up with a mess of:-
- I want to use cp $a $b
- $a refers to DML.....
- $DML.... refers to $INF.... and a file.
It's just too messy.
Are the records in
$AI_BIN/input.txt also variable names or variable assignments that you want to use? Can you share the format of that file so we can see what are trying to process.
Try to slim the code down to the minimal structure and just have a one record input file to your loop, then after pasting it into the thread along with the content of
$AI_BIN/input.txt, can you run the script with
ksh -x yourscript to illustrate where it is going. It might be obvious to you then, but if not I'm sure we can discuss it further.
Robin