bug-gawk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug-gawk] How not to escape sequence in awk? Or how to unescape sequenc


From: Peng Yu
Subject: [bug-gawk] How not to escape sequence in awk? Or how to unescape sequence for awk?
Date: Thu, 25 Apr 2013 11:01:41 -0500

Hi,

I want awk to print '\<xyz\>'.

~$ awk -v "x='\<xyz\>'" 'BEGIN{print x}'
awk: warning: escape sequence `\<' treated as plain `<'
awk: warning: escape sequence `\>' treated as plain `>'
'<xyz>'

I could manually do the following, but when the string '\<xyz>\' is
generated from from another program. I'll have to either have a 3rd
program to unescape the sequence or have awk stop escaping. Does any
of the two exist?

~$ awk -v "x='\\\<xyz\\\>'" 'BEGIN{print x}'
'\<xyz\>'

-- 
Regards,
Peng



reply via email to

[Prev in Thread] Current Thread [Next in Thread]