Re: String replacement drops leading '-e' if replacing char is a space
From:
Zachary Santer
Subject:
Re: String replacement drops leading '-e' if replacing char is a space
Date:
Mon, 14 Aug 2023 08:52:35 -0400
On Mon, Aug 14, 2023 at 1:27 AM Eduardo Bustamante <dualbus@gmail.com>
wrote:
> The echo command is consuming the '-e', as it is a flag. Instead, try
> using:
>
> printf '%s\n' "${x/,/ }"
>
Or just redefine your echo, lol.
echo() {
local IFS=' '
printf '%s\n' "${*}"
}
Nah, just don't ever use echo for printing variables. That's just a rule of
thumb that everyone needs to know.