I have a requirement where i have a sql file (filetext.sql). This file contains a variable ss_code.
Now in a shell script im trying to replace the variable ss_code with a value contained in the shell script variable MTK_DC..tried the below in the script
MTK_DC="mit,cit,bit"
OUT=`awk -v ss_code=$MTK_DC '{print}' filetext.sql` # prints as such the sql file .. without replacing the variable
MTK_DC="mit,cit,bit"
OUT=`awk -v bb_code=$MTK_DC '{gsub(ss_code, "bb_code")}1' filetext.sql` # this gives undesired output
Kindly throw some light..
Pls note:sql file and the shell script file are two different files present in the same location