Function: eshell/echo
eshell/echo is a byte-compiled function defined in em-basic.el.gz.
Signature
(eshell/echo &rest ARGS)
Documentation
Implementation of echo. See eshell-plain-echo-behavior.
Source Code
;; Defined in /usr/src/emacs/lisp/eshell/em-basic.el.gz
(defun eshell/echo (&rest args)
"Implementation of `echo'. See `eshell-plain-echo-behavior'."
(eshell-eval-using-options
"echo" args
'((?n nil (nil) output-newline
"do not output the trailing newline")
(?N nil (t) output-newline
"terminate with a newline")
(?E nil nil _disable-escapes
"don't interpret backslash escapes (default)")
(?h "help" nil nil
"output this help screen")
:preserve-args
:usage "[OPTION]... [OBJECT]...")
(if eshell-plain-echo-behavior
(eshell-echo args (if output-newline (car output-newline) t))
;; In Emacs 28.1 and earlier, "-n" was used to add a newline to
;; non-plain echo in Eshell. This caused confusion due to "-n"
;; generally having the opposite meaning for echo. Retain this
;; compatibility for the time being. For more info, see
;; bug#27361.
(when (equal output-newline '(nil))
(display-warning
'(eshell echo)
"To terminate with a newline, you should use -N instead."))
(eshell-echo args output-newline))))