On Sat, Jul 18, 2015 at 11:31 PM, Eric Sunshine <sunshine@xxxxxxxxxxxxxx> wrote: > On Sat, Jul 18, 2015 at 11:21 AM, Ben Walton <bdwalton@xxxxxxxxx> wrote: >> It seems that xpg4/tr mishandles some strings involving [ not followed >> by a character class: >> % echo '[::1]' | /usr/xpg4/bin/tr -d '[]' >> [::1 >> >> % echo '[::1]' | /usr/xpg4/bin/tr -d '[' >> usr/xpg4/bin/tr: Bad string. >> >> This was breaking two tests. To fix the issue, use the octal >> representations of [ and ] instead. >> >> Signed-off-by: Ben Walton <bdwalton@xxxxxxxxx> >> --- >> - ehost=$(echo $3 | tr -d "[]") >> + ehost=$(echo $3 | tr -d "\133\135") > > These octal values are somewhat opaque. To make this more > self-documenting, would it make sense instead to define a global > variable named 'brackets' or 'squarebrackets' (or something) and then > reference that variable in each of the 'tr' commands? > > brackets='\133\135' > ... > ehost=$(echo $3 | tr -d $brackets) Quoted, of course: ehost=$(echo $3 | tr -d "$brackets") -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html