bug-gawk
[Top][All Lists]
Advanced

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

[bug-gawk] Not to escape with -v and with ''


From: Peng Yu
Subject: [bug-gawk] Not to escape with -v and with ''
Date: Sun, 18 Nov 2018 11:13:29 -0600

Hi,

Strings are escaped with -v. But I am not sure if this is necessary,
as special characters can be taken using shell's capabilities. But
disabling escape can make regex string input much easier. The only
problem is that there may be compatibility issues. Is this behavior
dictated by any official standard?

$ awk -v x='\\' 'BEGIN { print x}'
\
$ mawk -v x='\\' 'BEGIN { print x}'
\
$ awk -v x='\t' 'BEGIN { print x}' | cat -t
$ awk -v x=$'\t' 'BEGIN { print x}' | cat -t
^I

Also, can single quote be supported so that strings are taken
literally without interpreting escaping with backslash? Thanks.

-- 
Regards,
Peng



reply via email to

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