bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#59403: 29.0.50; Variable with value starting with dash "-" fails to


From: Jim Porter
Subject: bug#59403: 29.0.50; Variable with value starting with dash "-" fails to create
Date: Sat, 19 Nov 2022 22:50:18 -0800

On 11/19/2022 10:08 PM, Milan Zimmermann wrote:
Actual:

~/dev $ export a="-anything"
~/dev $ echo $a
echo: unrecognized option -a
~/dev/ $ echo "$a"
echo: unrecognized option -a

Expected:

~/dev $ export a="-anything"
~/dev $ echo $a
-anything
~/dev/ $ echo "$a"
-anything
[snip]
Major mode: Eshell

Eshell's 'echo' command works somewhat different from other shells (in more ways than just this). The Eshell way to spell this is:

  ~ $ echo -- $a
  -anything

(Maybe this could be a feature enhancement for Eshell's echo, but "--" is the usual way to do this sort of thing with other commands, at least these days. Arguably, this makes Eshell's echo better, since it's more consistent with those other commands... at the expense of being less consistent with other implementations of echo.)






reply via email to

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