[mosh-devel] mosh used for one-off commands and/or independent of ssh

Keith Winstein keithw at MIT.EDU
Tue Oct 2 22:14:42 EDT 2012


On Tue, Oct 2, 2012 at 8:58 PM, Timo Sirainen <tss at iki.fi> wrote:
> # mosh host 'echo foo'|wc

I think you just want:

$ mosh host echo foo

(no quotation marks)

This will print "foo" and then "[mosh is exiting.]". But yes, it does
still treat the output as going to a terminal and probably only
captures the last screenful. (With single quotation marks, it tries to
exec an "echo foo" program, which doesn't exist.)

Mosh does fix some unfortunate quoting bugs in SSH, thanks to Anders,
Nelson, and others. Compare:

$ echo "Hell's kitchen"
Hell's kitchen
$ mosh trolley.csail.mit.edu echo "Hell's kitchen"
Hell's kitchen

[mosh is exiting.]
$ ssh trolley.csail.mit.edu echo "Hell's kitchen"
bash: -c: line 0: unexpected EOF while looking for matching `''
bash: -c: line 1: syntax error: unexpected end of file

-Keith



More information about the mosh-devel mailing list