Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to escape ' in awk 3

Status
Not open for further replies.

bishop7

Technical User
Jan 26, 2004
3
US
Can someone please tell me how to escape ' in the printf of an awk script.

Here is an example
nawk '{printf("exec dbms_system.SET_BOOL_PARAM_IN_SESSION(%s,%s,\'\n",$1,$2)}' $tracefile >xx

it's the first ' right before the \n" that's blowing up.

Thanks

 
nawk '{printf("exec dbms_system.SET_BOOL_PARAM_IN_SESSION(%s,%s,%c\n",$1,$2, 39)}' $tracefile >xx

vlad
+----------------------------+
| #include<disclaimer.h> |
+----------------------------+
 
Try something like this:
nawk '{printf(&quot;exec dbms_system.SET_BOOL_PARAM_IN_SESSION(%s,%s,'&quot;'&quot;'\n&quot;,$1,$2)}' $tracefile >xx

Hope This Help
PH.
 
Or use the octal number of the ascii character...
[tt]
printf &quot;\047\n&quot;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top