Subject: bash extraction of segment from end of string returns full string
From: <[email-masked]>
To: <[email-masked]>
Date: Fri, 09 May 2025 06:36:27 +0000
List-Id: <debbugs-submit.debbugs.gnu.org>

GNU bash, version 5.2.32(1)-release (x86_64-redhat-linux-gnu)

Copyright (C) 2022 Free Software Foundation, Inc.

License GPLv3+: GNU GPL version 3 or later < http://gnu.org/licenses/gpl.html >

In Fedora 41.

${parameter:-offset} and ${parameter:-offset:length} return full parameter.

carl@fedora:~$ a=12345

carl@fedora:~$ echo ${a:-2}

12345

carl@fedora:~$ echo ${a:-3:2}

12345