ssh host echo bla | echo bla
Nicolas Williams
Nicolas.Williams at ubsw.com
Wed Dec 19 02:33:37 EST 2001
On Tue, Dec 18, 2001 at 02:37:53AM +0300, Michael Tokarev wrote:
> Nicolas Williams wrote:
> []
> > - with -1, if stdout is a dead pipe, then ssh trie to open /dev/tty?
> > - with -2, if stdout is a dead pipe, then ssh exits?
> >
> > Why should one behaviour be correct and the other not?
> >
> > I mean, if you've got a broken pipe, print a message to stderr about it,
> > and if that's broken too, oh well. Either way exit.
> >
> > So I would say that the -1 behaviour is forgiving, but the -2 behaviour
> > is correct.
>
> Them aren't consistent at the end. And -2 doesn't print the error
> message (and not tries to logon to remote host). Can't say about
> logging in to remote, but the error message should be printed in
> both cases (stderr isn't closed, it's ssh's stdout that's closed).
> And both should exit with non-zero return code (imho):
Yes, the -2 should print an error; but what if stderr is also a broken
pipe? (Think "ssh -2 host /bin/echo foo 2>&1 | /bint/true").
And you're right about the exit status.
> Regards,
> Michael.
Nico
--
-DISCLAIMER: an automatically appended disclaimer may follow. By posting-
-to a public e-mail mailing list I hereby grant permission to distribute-
-and copy this message.-
Visit our website at http://www.ubswarburg.com
This message contains confidential information and is intended only
for the individual named. If you are not the named addressee you
should not disseminate, distribute or copy this e-mail. Please
notify the sender immediately by e-mail if you have received this
e-mail by mistake and delete this e-mail from your system.
E-mail transmission cannot be guaranteed to be secure or error-free
as information could be intercepted, corrupted, lost, destroyed,
arrive late or incomplete, or contain viruses. The sender therefore
does not accept liability for any errors or omissions in the contents
of this message which arise as a result of e-mail transmission. If
verification is required please request a hard-copy version. This
message is provided for informational purposes and should not be
construed as a solicitation or offer to buy or sell any securities or
related financial instruments.
More information about the openssh-unix-dev
mailing list