GNU bug report logs -
#54190
29.0.50; [PATCH] Incorrect/missing documentation for some Eshell "$" syntaxes
Previous Next
Reported by: Jim Porter <jporterbugs <at> gmail.com>
Date: Sun, 27 Feb 2022 21:35:02 UTC
Severity: minor
Tags: patch
Found in version 29.0.50
Done: Jim Porter <jporterbugs <at> gmail.com>
Bug is archived. No further changes may be made.
Full log
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
In the documentation for lisp/eshell/esh-var.el (and
`eshell-parse-variable-ref' in that file), it says that "$<FOO>" is a
way of accessing the value of the variable FOO to disambiguate the
length of the variable name, sort of like "${FOO}" in ordinary shells.
However, that's not actually true. The correct syntax for that is:
$"FOO"
;; or...
$'FOO'
In fact, what "$<FOO>" does is to run FOO as a subcommand, writing its
stdout to a temp file, and returning that file's name. This is (very!)
subtly implied in the Eshell manual in the "Bugs and ideas" section,
where it says:
`grep python $<rpm -qa>' doesn't work, but using `*grep' does
This happens because the `grep' Lisp function returns immediately,
and then the asynchronous `grep' process expects to examine the
temporary file, which has since been deleted.
Attached is a patch which updates the documentation to correctly
describe the current behavior. Note: since this is just a documentation
change, it might be worth pushing to the 28 branch.
[0001-Improve-correct-documentation-about-Eshell-variable-.patch (text/plain, attachment)]
This bug report was last modified 2 years and 255 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.