Re: Possible bug but looking for help before bothering a dev
From:
Jeffrey Walton
Subject:
Re: Possible bug but looking for help before bothering a dev
Date:
Wed, 4 Mar 2026 15:02:26 -0500
On Wed, Mar 4, 2026 at 2:47 PM Greg Wooledge <greg@wooledge.org> wrote:
> On Wed, Mar 04, 2026 at 13:48:18 -0500, Jeffrey Walton wrote:
> > Be careful of `echo "hahaha"`. Sometimes the `echo` command includes a
> new
> > line, and other times it does not. It depends on the version of the
> > command and whether the command was patched to a particular personality.
>
> echo is perfectly safe with a constant argument consisting entirely
> of letters. It only changes behavior when there are hyphens or
> backslashes in an argument. It's not safe to use with non-constant
> arguments, e.g. echo "$var", because those could contain punctuation
> that will trigger varying behaviors.
I was talking about echo, -n, and new line behavior. See, for example, <
https://stackoverflow.com/a/33785069>.
Jeff