Bash not interpreting negative offsets in Substrring Expanison of parameters

Bug #1920967 reported by Kevin O'Gorman
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
bash (Ubuntu)
New
Undecided
Unassigned

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)

Revision history for this message
Kevin O'Gorman (kogorman-pacbell) wrote :
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.