> > 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 >
The echo command is consuming the '-e', as it is a flag. Instead, try using: printf '%s\n' "${x/,/ }"