bug-gawk
[Top][All Lists]
Advanced

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

Re: [bug-gawk] Is there a way to print a character in the escaped form?


From: arnold
Subject: Re: [bug-gawk] Is there a way to print a character in the escaped form?
Date: Wed, 23 Jan 2019 23:55:12 -0700
User-agent: Heirloom mailx 12.5 7/5/10

Peng Yu <address@hidden> wrote:

> On Wed, Jan 23, 2019 at 1:05 AM <address@hidden> wrote:
> >
> > Peng Yu <address@hidden> wrote:
> >
> > > I'd expect something more like %q in Go Printf() beatifically print
> > > the control characters.
> >
> > Why would you expect this?  It's not in POSIX, nor has it ever been in
> > awk, nor is it necessary to dump every possible feature from every other
> > programming language into gawk.
> >
> > > It can not be easily done in awk?
> >
> > See the solution David already provided you.
>
> bash's printf also support %q. I think that it is common nowadays to
> support %q. There is no reason why gawk cannot support it.

I can think of a number of reasons not to support it.

In any case, feel free to submit a patch; you may even be able to
borrow some of the code from bash's printf.

You can find instructions for contributing code to gawk at
https://www.gnu.org/software/gawk/manual/html_node/Additions.html#Additions.

Along with code changes, please include updates to the Texinfo manual
and to the troff man page, as well as at least one additional program
for the test suite.

Thanks!

Arnold



reply via email to

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