bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

String replacement drops leading '-e' if replacing char is a space


From: pphick
Subject: String replacement drops leading '-e' if replacing char is a space
Date: Mon, 14 Aug 2023 02:11:27 +0000

Configuration Information [Automatically generated, do not change]:
Machine: x86_64
OS: linux-gnu
Compiler: gcc
Compilation CFLAGS: -g -O2 -flto=auto -ffat-lto-objects -flto=auto 
-ffat-lto-objects -fstack-protector-strong -Wformat -Werror=format-s>
uname output: Linux saturn 6.2.6-76060206-generic 
#202303130630~1689015125~22.04~ab2190e~dev-Ubuntu SMP PREEMPT_DY x86_64 x86_64 
x86_64>
Machine Type: x86_64-pc-linux-gnu

Bash Version: 5.1
Patch Level: 16
Release Status: release

Description:

If a string starts with '-e' the replacement operators ${x//,/ } and ${x/, /} 
drop the '-e'.
The behaviour seems to be very specific: the string must start with '-e' and 
the replacing character has to be a space.

Repeat-By:

x='-e,b,c'
echo ${x//,/ }
b c
echo ${x/,/ }
b,c

P. Paul Hick
Email: pphick@protonmail.com

reply via email to

[Prev in Thread] Current Thread [Next in Thread]