Hi All ,
I am setting variables as shown below
PHP Code:
setenv MODULE1 modem_1_3
setenv MODULE2 modem5_1_2
setenv MODULE3 modem5_1
setenv MODULE4 modem5_2_top_a
setenv COUNT 4
I am having another bash script as shown below
########################################################
HTML Code:
#!/bin/bash
for (( c=1; c<=${COUNT}; c++ ))
do
sed -n '/module '${MODULE}'${c} /,/endmodule/p' prescan.v > temp${c}.v
sed -i '0,/o_func_clk /s/o_func_clk/o_func_clk, DFT_ClkEnScanIn1 ,scan_clock_en , DFT_ClkgenScanEnable /' temp${c}.v
#sed -i '0,/i_UDR_DFT_free_running;/i_UDR_DFT_free_running;/i_UDR_DFT_free_running , DFT_ClkEnScanIn1 , DFT_ClkgenScanEnable ;/' temp${c}.v
sed -i 's/i_UDR_DFT_free_running;/i_UDR_DFT_free_running , DFT_ClkEnScanIn1 , DFT_ClkgenScanEnable ;/' temp${c}.v
sed -i '/\[0\:0\] i_func_clk_en/a output scan_clock_en ;' temp${c}.v
sed -i '/scan_clock_en_reg/,+1d' temp${c}.v
sed -i '/endmodule/i M8E35B_SDFF2X1 scan_clock_en_reg (.q ( scan_clock_en ) , .d (pre_scan_clock_en ) , .te ( DFT_ClkgenScanEnable ) , .ti ( DFT_ClkEnScanIn1 ) , .phi ( i_scan_clk ));' temp${c}.v
done
################################################################
This script should go in loop and create different files temp1.v temp2.v temp3.v and temp4.v
My problem is in the first line
sed -n '/module '${MODULE}'${c} /,/endmodule/p' prescan.v > temp${c}.v
variable substition is not happening and temp is not getting created
I tried with double quotes but then also its not working ...
Incrementing the $c in the loop and $Module1 or $Module2 like that should be read as defined in environment variable and substitution should happen but I am getting empty temp files
Please let me know how to tackle this issue ?