Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

11
  • 6
    Quite bizzare, "^^" and ",," operators don't work on non-ASCII characters but "~~" does... So string="łódź"; echo ${string~~} will return "ŁÓDŹ", but echo ${string^^} returns "łóDź". Even in LC_ALL=pl_PL.utf-8. That's using bash 4.2.24. Commented Jul 12, 2012 at 16:48
  • 2
    @HubertKario: That's weird. It's the same for me in Bash 4.0.33 with the same string in en_US.UTF-8. It's a bug and I've reported it. Commented Jul 12, 2012 at 18:20
  • 1
    @HubertKario: Try echo "$string" | tr '[:lower:]' '[:upper:]'. It will probably exhibit the same failure. So the problem is at least partly not Bash's. Commented Jul 13, 2012 at 0:44
  • 1
    @DennisWilliamson: Yeah, I've noticed that too (see comment to Shuvalov answer). I'd just say, "this stuff is only for ASCII", but then it's the "~~" operator that does work, so it's not like the code and translation tables aren't already there... Commented Jul 14, 2012 at 14:13
  • 4
    @HubertKario: The Bash maintainer has acknowledged the bug and stated that it will be fixed in the next release. Commented Jul 14, 2012 at 14:27