single quotes in awk statement

Hi,

I have written a code to modify a string say,

StringA=abc,def,ghi

I need to change it to something like:

StringB=This means abc='ABC', This mean def='DEF', This means ghi= 'GHI'
StringB=$(echo $StringA | awk -F',' 'BEGIN { OFS="," } { for (i=1; i<=NF;i++) $i="This means "$i"='ABC'")) THEN '' ELSE " $1 ; print $0 }')

I am not able to print the single quotes to the output or rather assign to String B

If I understand you correctly, you just need to escape the single quotes that you are wanting to print.

echo 'This is a \'test\''

Sorry i forgot to put that in my earlier example. I did use the \ to escape the single quotes, but it doesn't work

StringB=$(echo $StringA | awk -F',' 'BEGIN { OFS="," } { for (i=1; i<=NF;i++) $i="This means "$i"=\'ABC\'")) THEN '' ELSE " $1 ; print $0 }')