On Oct 22, 2016 02:41, "Michael Forney" <[email protected]> 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.
