It happens that you want to generate a section of SQL script in awk, so it involves printing a single quote in a statement.
EG1: When the string is echo AAA | awk ' {print ' select * from A where name= '/' TOM '/' "} '
EG2: When for a field echo TOM | awk ' {print ' select * from A where name= '/' '
EG3: Key=tom When the variable is in the shell; echo AAA | awk ' {print ' select * from A where name= '/' $key '/' "} '
Note: Enclose the escaped single quotes in single quotes such as awk ' {print '/' ' '} '
EG1: Single Primer-Double Primer-single-Escape single primer-single lead-keystr-single lead-escape single primer-single lead-double lead-single lead
EG2: Single Primer-Double Primer-single-Escape single Primer-Single primer-dual-lead-keystr-double Primer-Single lead-escape single primer-single lead-double lead-single lead
EG2: Single Primer-Double Primer-single lead-escape single Primer-Single Primer-single lead-keystr-single Primer-single lead-escape single primer-single lead-double lead-single lead
Note: The three special characters enclosed in double quotes in awk are not ignored: $,/, ' that is, double quotes explain the special meaning of strings, and single quotes use string output directly