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 Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1920967 Title: Bash not interpreting negative offsets in Substrring Expanison of parameters To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/bash/+bug/1920967/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs