From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Sylvain Chouleur Newsgroups: gmane.emacs.bugs Subject: bug#16582: Bug: tramp shell command doesn't read stdin Date: Wed, 5 Feb 2014 10:44:03 +0100 Message-ID: References: <87k3di97pa.fsf@gmx.de> <87eh3k5pdb.fsf@gmx.de> <87zjm6rmi1.fsf@gmx.de> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a113940ca14653804f1a59a52 X-Trace: ger.gmane.org 1391593511 6982 80.91.229.3 (5 Feb 2014 09:45:11 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 5 Feb 2014 09:45:11 +0000 (UTC) Cc: 16582@debbugs.gnu.org To: Michael Albinus Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Feb 05 10:45:18 2014 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1WAz2k-0008V3-BZ for geb-bug-gnu-emacs@m.gmane.org; Wed, 05 Feb 2014 10:45:18 +0100 Original-Received: from localhost ([::1]:58244 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WAz2k-0005sN-0b for geb-bug-gnu-emacs@m.gmane.org; Wed, 05 Feb 2014 04:45:18 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:54112) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WAz2c-0005l4-7R for bug-gnu-emacs@gnu.org; Wed, 05 Feb 2014 04:45:15 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WAz2X-0000jB-0t for bug-gnu-emacs@gnu.org; Wed, 05 Feb 2014 04:45:10 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:36164) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WAz2W-0000fS-OM for bug-gnu-emacs@gnu.org; Wed, 05 Feb 2014 04:45:04 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1WAz2U-0006l6-SQ for bug-gnu-emacs@gnu.org; Wed, 05 Feb 2014 04:45:03 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Sylvain Chouleur Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 05 Feb 2014 09:45:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 16582 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 16582-submit@debbugs.gnu.org id=B16582.139159346925922 (code B ref 16582); Wed, 05 Feb 2014 09:45:02 +0000 Original-Received: (at 16582) by debbugs.gnu.org; 5 Feb 2014 09:44:29 +0000 Original-Received: from localhost ([127.0.0.1]:50183 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WAz1w-0006k2-9K for submit@debbugs.gnu.org; Wed, 05 Feb 2014 04:44:28 -0500 Original-Received: from mail-qa0-f43.google.com ([209.85.216.43]:33496) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WAz1s-0006jq-AF for 16582@debbugs.gnu.org; Wed, 05 Feb 2014 04:44:24 -0500 Original-Received: by mail-qa0-f43.google.com with SMTP id o15so177266qap.2 for <16582@debbugs.gnu.org>; Wed, 05 Feb 2014 01:44:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=/Hp9YUpwG/OyBrvw8vDxt6sDi9IYOX91Gbu9LdMvUV4=; b=d4n8smvEwSH4Jd7SZHDQIRpFMi4Mvq12sUdzRavh5ZRcxsDniIpujCRYyokCliygB0 0a7rV6fyK4bWVgQdaGRrZItRux5uDPw0fwbwjL8RHsRZDd9BNTjUMvgfIsgeikiH2GdX 1uMBZawdYCybAoMmu28zab/Hc79FdvvkvvHIbC8oFDob6t8kEJYEv30eGdakzAuszSMp UJOA0LQ5kBdmm6jRULdrtXP7UjEJmMwx/F3qrsqdxxJVRMv5fv9/7jhOD1h3S3wUlVkk WQOb9Y4RK3AKcnlpF5gVDHb5ihy7uHm1Fx/s3OwFVEotTwKlqOdlFjFMTOYXwwqnqr3C w5Vg== X-Received: by 10.140.105.35 with SMTP id b32mr802588qgf.36.1391593463766; Wed, 05 Feb 2014 01:44:23 -0800 (PST) Original-Received: by 10.96.63.134 with HTTP; Wed, 5 Feb 2014 01:44:03 -0800 (PST) In-Reply-To: <87zjm6rmi1.fsf@gmx.de> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:84611 Archived-At: --001a113940ca14653804f1a59a52 Content-Type: text/plain; charset=ISO-8859-1 I'm sorry, may be I was not clear: replacing EOF by another delimiter does not solve anything, it just make the way tramp uses heredocs more robust because it avoids conflicts with user commands potentially using the same delimiter. That said, we still have the original issue of the bz I raised: by executing tramp shell commands in this way: exec <<'EOF' bash EOF we loose the possibility to send user inputs to bash, so commands like 'read' will not work. That's why I proposed the two approaches to handle your problem (long line arguments) and my problem (bash stdin) -- Sylvain 2014-02-05 Michael Albinus : > Sylvain Chouleur writes: > > > Hi Michael, > > Hi Sylvain, > > > replacing EOF delimiter by a md5sum works well. > > Good. > > > The process substitution works only for real bash shells, or zsh. > > It does not work with sh or busybox. > > > > So I think we have two solutions here: > > - Support multiple methods, chosen by user configuration: > > -> bash -c "cmd" which doesn't support very long commands > > -> bash < > -> bash <(cat < > basic shells like sh or busybox (works with bash and zsh) > > - Reproduce method 3 by writting commands in a target's temporary > > file, launch the shell with this file in argument, and finally remove > > the file from the target. > > > > The last solution have the major drawback to execute extra commands > > each time and to have a writable filesystem usable on the target > > I don't get your point. If my patch works well (as you said above), why > do you want to change something else? > > If you still have problems with my patch, please give me an exact recipe > what triggers the problem. I cannot reproduce the problem here, sorry. > A Tramp debug buffer, produced with tramp-verbose set to 6, would help. > > > Cheers, > > Best regards, Michael. > --001a113940ca14653804f1a59a52 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
I'm sorry, may be I was not clear:

= replacing EOF by another delimiter does not solve anything, it just make th= e way tramp uses heredocs more robust because it avoids conflicts with user= commands potentially using the same delimiter.

That said, we still have the original issue of the bz I= raised:
by executing tramp shell commands in this way:
exec <<'EOF' bash
<commands>
EOF

we loose the possibilit= y to send user inputs to bash, so commands like 'read' will not wor= k.
That's why I proposed the two approaches to handle y= our problem (long line arguments) and my problem (bash stdin)

--=A0
Sylvain


2014-02-05 Mich= ael Albinus <michael.albinus@gmx.de>:
Sylvain Chouleur <sylvain.chouleur@gmail.com> writes:

> Hi Michael,

Hi Sylvain,

> replacing EOF delimiter by a md5sum works well.

Good.

> The process substitution works only for real bash shells, or zsh.
> It does not work with sh or busybox.
>
> So I think we have two solutions here:
> - Support multiple methods, chosen by user configuration:
> -> bash -c "cmd" which doesn't support very long comm= ands
> -> bash <<EOF which doesn't support stdin
> -> bash <(cat <<EOF) which supports all but which doesn= 9;t works on
> basic shells like sh or busybox (works with bash and zsh)
> - Reproduce method 3 by writting commands in a target's temporary<= br> > file, launch the shell with this file in argument, and finally remove<= br> > the file from the target.
>
> The last solution have the major drawback to execute extra commands > each time and to have a writable filesystem usable on the target

I don't get your point. If my patch works well (as you said above= ), why
do you want to change something else?

If you still have problems with my patch, please give me an exact recipe what triggers the problem. I cannot reproduce the problem here, sorry.
A Tramp debug buffer, produced with tramp-verbose set to 6, would help.

> Cheers,

Best regards, Michael.

--001a113940ca14653804f1a59a52--