Re: [hackers] [sbase] [PATCH] tr: Fix multiple ranges with different lengths

From: Evan Gates <evan.gates_AT_gmail.com>
Date: Sat, 22 Oct 2016 09:43:30 -0700

On Oct 22, 2016 02:41, "Michael Forney" <mforney_AT_mforney.org> wrote:
> This also fixes range expressions in the form [a-z], which get encoded as
four
> ranges '[', 'a'..'z', ']', causing all a-z characters to get mapped to
']'. This
> form is occasionally used in shell scripts, including the syscalltbl.sh
script
> used to build linux.

Can you provide an example of what you mean? Brackets are not special
unless they are used for character classes or equivalence classes. An
argument of the form '[a-z]' means a set containing characters left
bracket, a to z, right bracket, and almost certainly the author meant just
'a-z'. Argument '[:lower:]' is a character class. There is often a
misconception that tr takes opening and closing brackets due to their use
in regex, but the arguments to tr are supposed to only be what would go
inside those brackets in the regex, the brackets themselves should be
omitted.
Received on Sat Oct 22 2016 - 18:43:30 CEST

This archive was generated by hypermail 2.3.0 : Sat Oct 22 2016 - 18:48:15 CEST