[Top][All Lists]

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

Re: 6.0 release

From: arnold
Subject: Re: 6.0 release
Date: Sun, 10 May 2015 07:47:27 -0600
User-agent: Heirloom mailx 12.4 7/29/08

Eli Zaretskii <address@hidden> wrote:

> While playing with texindex.awk, I found a surprising misfeature.
> Observe:
>   gawk -v Invocation_name="foo\texindex.awk" -f texindex\texindex.awk -- 
> --help
>   Usage: foo      exindex.awk [OPTION]... FILE...
>   Generate a sorted index for each TeX output FILE.
>   Usually FILE... is specified as `foo.??' for a document `foo.texi'.
> Note that strange "foo      exindex.awk" part: this is Gawk
> interpreting \t in Invocation_name as a TAB!

This is standard awk behavior, not a misfeature.  It's even documented.

> This comes from this line in texindex.awk:
>   printf(_"Usage: %s [OPTION]... FILE...\n", Invocation_name)
> Given that 'printf' in Awk interprets escape sequences

It does not. The string value of the variable contains a tab.
But the %s outputs the value of the variable without interpreting it.

> how about making function 'usage' smarter about that?

What should it do?  gsub(/\t/, "\\t", Invocation_name)?

If on Windows you use a forward slash, everything will work.



reply via email to

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