Function: eshell-remote-command
eshell-remote-command is a byte-compiled function defined in
esh-ext.el.gz.
Signature
(eshell-remote-command COMMAND ARGS)
Documentation
Insert output from a remote COMMAND, using ARGS.
A remote command is something that executes on a different machine. An external command simply means external to Emacs.
Note that this function is very crude at the moment. It gathers up all the output from the remote command, and sends it all at once, causing the user to wonder if anything's really going on...
Source Code
;; Defined in /usr/src/emacs/lisp/eshell/esh-ext.el.gz
(defun eshell-remote-command (command args)
"Insert output from a remote COMMAND, using ARGS.
A remote command is something that executes on a different machine.
An external command simply means external to Emacs.
Note that this function is very crude at the moment. It gathers up
all the output from the remote command, and sends it all at once,
causing the user to wonder if anything's really going on..."
(let ((outbuf (generate-new-buffer " *eshell remote output*"))
(errbuf (generate-new-buffer " *eshell remote error*"))
(command (file-local-name command))
(exitcode 1))
(unwind-protect
(progn
(setq exitcode
(shell-command
(mapconcat #'shell-quote-argument
(append (list command) args) " ")
outbuf errbuf))
(eshell-print (with-current-buffer outbuf (buffer-string)))
(eshell-error (with-current-buffer errbuf (buffer-string))))
(eshell-close-handles exitcode 'nil)
(kill-buffer outbuf)
(kill-buffer errbuf))))