Public bug reported: According to the man page, $(variable:offset[:length]} should treat negative offsets as counting from the end of the value. Instead, I find any such substring expansion expands the ENTIRE variable regardless of the exact negative offset or any length provided.
A short typescript is attached. It shows two good expansions followed by three bad ones. ProblemType: Bug DistroRelease: Ubuntu 20.04 Package: bash 5.0-6ubuntu1.1 ProcVersionSignature: Ubuntu 5.4.0-66.74-generic 5.4.86 Uname: Linux 5.4.0-66-generic x86_64 NonfreeKernelModules: wl ApportVersion: 2.20.11-0ubuntu27.16 Architecture: amd64 CasperMD5CheckResult: skip CurrentDesktop: XFCE Date: Tue Mar 23 09:09:28 2021 SourcePackage: bash UpgradeStatus: Upgraded to focal on 2021-02-19 (32 days ago) ** Affects: bash (Ubuntu) Importance: Undecided Status: New ** Tags: amd64 apport-bug focal ** Attachment added: "showing what happens when I try it" https://bugs.launchpad.net/bugs/1920967/+attachment/5480253/+files/typescript -- You received this bug notification because you are a member of Ubuntu Touch seeded packages, which is subscribed to bash in Ubuntu. https://bugs.launchpad.net/bugs/1920967 Title: Bash not interpreting negative offsets in Substrring Expanison of parameters Status in bash package in Ubuntu: New Bug description: According to the man page, $(variable:offset[:length]} should treat negative offsets as counting from the end of the value. Instead, I find any such substring expansion expands the ENTIRE variable regardless of the exact negative offset or any length provided. A short typescript is attached. It shows two good expansions followed by three bad ones. ProblemType: Bug DistroRelease: Ubuntu 20.04 Package: bash 5.0-6ubuntu1.1 ProcVersionSignature: Ubuntu 5.4.0-66.74-generic 5.4.86 Uname: Linux 5.4.0-66-generic x86_64 NonfreeKernelModules: wl ApportVersion: 2.20.11-0ubuntu27.16 Architecture: amd64 CasperMD5CheckResult: skip CurrentDesktop: XFCE Date: Tue Mar 23 09:09:28 2021 SourcePackage: bash UpgradeStatus: Upgraded to focal on 2021-02-19 (32 days ago) To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/bash/+bug/1920967/+subscriptions -- Mailing list: https://launchpad.net/~touch-packages Post to : touch-packages@lists.launchpad.net Unsubscribe : https://launchpad.net/~touch-packages More help : https://help.launchpad.net/ListHelp