Path: csiph.com!xmission!news.snarked.org!news.linkpendium.com!news.linkpendium.com!panix!usenet.stanford.edu!not-for-mail From: Bize Ma Newsgroups: gnu.bash.bug Subject: Bash removes unrequested characters in bracket expressions (not a range). Date: Fri, 23 Nov 2018 19:09:09 -0400 Lines: 47 Approved: bug-bash@gnu.org Message-ID: NNTP-Posting-Host: lists.gnu.org Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Trace: usenet.stanford.edu 1543014568 11504 208.118.235.17 (23 Nov 2018 23:09:28 GMT) X-Complaints-To: action@cs.stanford.edu To: bug-bash , bash@packages.debian.org Envelope-to: bug-bash@gnu.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=JKTo3j20z+M4Vl1GiEYHWIcbVtWRlr0b/TF/plwnRTs=; b=JoFO5vbhHd7o6us42Gf4FVcxWn+rRkqvxGpFj+HI0uTOyzph9OvzRkRTbjs8EZup0u O3zOokvEXp/72fNCrvp4j7h/nEUtSwTyJ0u+PX5P/hhOJPdWgxOhUVWoua42PWOtf82j CsCUBSMaFUuLq7LArTxegmj+8VsWwXUXvgXzrqhT8IlsS4eogV2ypeOPxveqbgtUf4Ox tEmzEdzocgyQ6sUjT/00vigNjP+2P3vGCW30maDyW9yUjuWC8H6acdITdqknwgpy1dTb Ga3bAGpUsgChEd6qN4AbxRayvfHuf4KMNChMUopBM2r20xYbiXtKWkO9FqxvKXGmnAiB pL9g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=JKTo3j20z+M4Vl1GiEYHWIcbVtWRlr0b/TF/plwnRTs=; b=MA4SV8tpnVm99ryGYz6t6HyeA/J3w++NEoutNLKGgedNLAA787sFc0R8/zW9rSiOLq MhD5Jwhz8Twio7X1vT6mT70pED4A76JLR/fBqt9G8nllRgh8ydbq1lGT1j1H6YFIUsNU FmdBPEQeTD4KqS3wJpuPxc6pHDyzFDjA0J1jQ6aosWLGVw7L5fSOce0raLCrDov6oB0t CycwlSn1Rf2eEof5vGhgUEBpCuXJf1EWd2XHcQ9ItY+fAQ7CPhW6M6xLORaY19E0obFW eEDqOb0o0Bzmm2yE6vm8o/OzyzxVZdEkOLeS6462090V+ZwZcmWZIfdUcCqw22k7lQPH KoFw== X-Gm-Message-State: AGRZ1gLn8wpd6x4joaD+SdiQ7h1n6tYSUMHbxdF23cg74NvvKry1lcBP U6Ndeak3cwtYA9O9vhjkM7xznphtgV8b8AjwX3uA9qUw X-Google-Smtp-Source: AJdET5cTxD2o0NWzic2miv+FimcqHjncta6uwio9/XnyYPQkJmHGQksBfimU3ah7ZICs0RkN0yWBNX64xM3W2Lpeiq0= X-Received: by 2002:aca:d0c9:: with SMTP id j70mr10060678oiy.143.1543014561318; Fri, 23 Nov 2018 15:09:21 -0800 (PST) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::234 X-Content-Filtered-By: Mailman/MimeDel 2.1.21 X-BeenThere: bug-bash@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Bug reports for the GNU Bourne Again SHell List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Xref: csiph.com gnu.bash.bug:14847 Configuration Information [Automatically generated, do not change]: Machine: x86_64 OS: Linux-gnu Compiler: gcc Compilation CFLAGS: -DPROGRAM=3D'bash' -DCONF_HOSTTYPE=3D'x86_64' -DCONF_OSTYPE=3D'linux-gnu' -DCONF_MACHTYPE=3D'x86_64-pc-linux-gnu' -DCONF_VENDOR=3D'pc' -DLOCALEDIR=3D'/usr/share/locale' -DPACKAGE=3D'bash' -DSHELL -DHAVE_CONFIG_H -I. -I../. -I.././include -I.././lib -Wdate-time -D_FORTIFY_SOURCE=3D2 -g -O2 -fdebug-prefix-map=3D/build/bash-7fckc0/bash-4.4=3D. -fstack-protector-strong -Wformat -Werror=3Dformat-security -Wall -no-pie -Wno-parentheses -Wno-format-security uname output: Linux io 4.9.0-8-amd64 #1 SMP Debian 4.9.130-2 (2018-10-27) x86_64 GNU/Linux Machine Type: x86_64-pc-linux-gnu Bash Version: 4.4 Patch Level: 12 Release Status: release Description: Bash is removing characters not explicitly listed in a bracket expression (character range). In this example, it is removing digits from other languages. Also tested (and it fails) in bash 3.{0,1,3} 4.{1,2,3} and 5.0 Not a problem in bash 2.{0,1} Repeat-By: If the characters are a problem: please visit: https://unix.stackexchange.com/q/483743/265604 $ a=3D'0123456789 =D9=A0=D9=A1=D9=A2=D9=A3=D9=A4=D9=A5=D9=A6=D9=A7=D9= =A8=D9=A9 =DB=B0=DB=B1=DB=B2=DB=B3=DB=B4=DB=B5=DB=B6=DB=B7=DB=B8=DB=B9 =DF= =80=DF=81=DF=82=DF=83=DF=84=DF=85=DF=86=DF=87=DF=88=DF=89 =E0=A5=A6=E0=A5= =A7=E0=A5=A8=E0=A5=A9=E0=A5=AA=E0=A5=AB=E0=A5=AC=E0=A5=AD=E0=A5=AE=E0=A5=AF= ' $ echo "${a//[0123456789]}" =DB=B0=DB=B1=DB=B2=DB=B3=DB=B4=DB=B5=DB=B6=DB=B7=DB=B8=DB=B9 =DF=80= =DF=81=DF=82=DF=83=DF=84=DF=85=DF=86=DF=87=DF=88=DF=89 =E0=A5=A6=E0=A5=A7= =E0=A5=A8=E0=A5=A9=E0=A5=AA=E0=A5=AB=E0=A5=AC=E0=A5=AD=E0=A5=AE=E0=A5=AF