Hi,

GNU bash, version 5.3.3(1)-release[a8a1c2fa] (x86_64-slackware-linux-gnu)

| $ locale
| LANG=en_US.UTF-8
| LC_CTYPE="en_US.UTF-8"
| LC_NUMERIC="en_US.UTF-8"
| LC_TIME="en_US.UTF-8"
| LC_COLLATE=en_US.UTF-8
| LC_MONETARY="en_US.UTF-8"
| LC_MESSAGES="en_US.UTF-8"
| LC_PAPER="en_US.UTF-8"
| LC_NAME="en_US.UTF-8"
| LC_ADDRESS="en_US.UTF-8"
| LC_TELEPHONE="en_US.UTF-8"
| LC_MEASUREMENT="en_US.UTF-8"
| LC_IDENTIFICATION="en_US.UTF-8"
| LC_ALL=

I have this directory:-

| $ ls -1
| 0.txt
| ⁰.txt
| ₀.txt
| 1.txt
| ¹.txt
| ₁.txt
| 2.txt
| ².txt
| ₂.txt
| 3.txt
| ³.txt
| ₃.txt
| 4.txt
| ⁴.txt
| ₄.txt

`ls -1 [0-5]*` should produce the same output as `ls -1` but instead:-

| $ ls -1 [0-5]*
| 0.txt
| ⁰.txt
| ₀.txt
| 1.txt
| ₁.txt
| 2.txt
| ₂.txt
| 3.txt
| ₃.txt
| 4.txt
| ⁴.txt
| ₄.txt

superscripts ¹, ² & ³ are missing.

My take at an explanation: '₀' - '₉' are Unicode U+2080-9. These display fine.
'⁰' is U+2070 & '⁹' is U+2079, but '¹' is U+00B9, '²' is U+00B2 & '³' is U+00B3.

Suggested fix: Bash glob ranging needs to special-case ¹, ² & ³ much the same
way as it special-cases 'ⁱ' (U+2071 which immediately follows '⁰'):-

| $ ls -1
| i.txt
| ⁱ.txt
| j.txt

| ls -1 [i-j]*
| i.txt
| ⁱ.txt
| j.txt

The codepoints are from https://en.wiktionary.org/wiki/Appendix:Unicode

Cheers ... Duncan.

  • Bash glob range ... Duncan Roe via Bug reports for the GNU Bourne Again SHell

Reply via email to