I have the below requirement to concatenate the value of a variable to its own variable and create one array:
Table=CRS
Job=JOBNAME
gen_job_$Table=GENERATEDJOB
gen_job_$TABLE=$Job,${gen_job_${Table}}
echo ${gen_job_${Table}} should give JOBNAME,GENERATEDJOB
I tried using the eval function also as below:
eval gen_job_$Table=$job,eval echo \$gen_job_$Table
However, I am not able to display the final result.
gen_job_$Table=GENERATEDJOB, are you using a dollar sign inside a variable name? I don't actually know if that's valid. I tried it, and was given an error.var1=10; a=1; str=var$a; echo ${!str}Output is10