From debbugs-submit-bounces@debbugs.gnu.org Tue Jan 28 17:43:26 2014 Received: (at submit) by debbugs.gnu.org; 28 Jan 2014 22:43:27 +0000 Received: from localhost ([127.0.0.1]:39638 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1W8HNO-0007hr-8e for submit@debbugs.gnu.org; Tue, 28 Jan 2014 17:43:26 -0500 Received: from eggs.gnu.org ([208.118.235.92]:55467) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1W8HKc-0007dK-0M for submit@debbugs.gnu.org; Tue, 28 Jan 2014 17:40:34 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W8HKa-0000a2-Ak for submit@debbugs.gnu.org; Tue, 28 Jan 2014 17:40:33 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-0.6 required=5.0 tests=BAYES_00,FREEMAIL_FROM, HTML_MESSAGE,TRACKER_ID,T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([208.118.235.17]:55170) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W8HKa-0000Zc-1b for submit@debbugs.gnu.org; Tue, 28 Jan 2014 17:40:32 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57176) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W8HKY-0004yl-EB for bug-gnu-emacs@gnu.org; Tue, 28 Jan 2014 17:40:31 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W8HKX-0000TI-4a for bug-gnu-emacs@gnu.org; Tue, 28 Jan 2014 17:40:30 -0500 Received: from mail-qa0-x22b.google.com ([2607:f8b0:400d:c00::22b]:39316) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W8HKW-0000MT-3d for bug-gnu-emacs@gnu.org; Tue, 28 Jan 2014 17:40:28 -0500 Received: by mail-qa0-f43.google.com with SMTP id o15so1410123qap.16 for ; Tue, 28 Jan 2014 14:40:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:from:date:message-id:subject:to:content-type; bh=xqbLbVsVcQWWQ1oQqdftQ/qtViPY89XMMRwEzteCmvs=; b=R3asEOjD1WzrL0YDbPJkfsKyfp5gS3/hsDa/RfZbHVG0FjAjPw+bap+JH7FKZjGb2P p9TYtMNCcBw2mnzTIo3OQMtGSOxH5dxTvVWAUjQZbuRXXamFsXx7TH6cIjT0hViq0Atc F1DOIiBh8GIZQlWLDlkY4gCFtS1UN58/n5IxbBwvyxrFlSQIr1YDBJ5MO3QVEtAI8ccG qrWrwjwvwfCOSO6ne3gdE+7QYQSl+0DYnZGjbNl0SWaEeA9vpkVmeCVgW1ijD2B03YX5 TKm+uIYgCjQr/58U42eCUASp82F0jTX2DtZ/Lwd7XEG37Arki7u+dPE1zOcCR1wWQUC4 vgAw== X-Received: by 10.140.105.35 with SMTP id b32mr6498690qgf.36.1390948826493; Tue, 28 Jan 2014 14:40:26 -0800 (PST) MIME-Version: 1.0 Received: by 10.96.63.134 with HTTP; Tue, 28 Jan 2014 14:40:06 -0800 (PST) From: Sylvain Chouleur Date: Tue, 28 Jan 2014 23:40:06 +0100 Message-ID: Subject: Bug: tramp shell command doesn't read stdin To: bug-gnu-emacs@gnu.org Content-Type: multipart/alternative; boundary=001a113940cab4399304f10f8205 X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 208.118.235.17 X-Spam-Score: -2.9 (--) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Tue, 28 Jan 2014 17:43:24 -0500 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.9 (--) --001a113940cab4399304f10f8205 Content-Type: text/plain; charset=ISO-8859-1 Hi, there is a regression introduced by this commit: e43048325611953396186b569447a3754422ddc3 Author: Michael Albinus Date: Fri Dec 6 16:34:06 2013 +0100 Bug#16045 * progmodes/compile.el (compilation-start): * progmodes/grep.el (rgrep): Revert change of 2012-12-20 (r111276). * net/tramp-sh.el (tramp-sh-handle-start-file-process): Handle long command lines, lasting from "sh -c ...". (Bug#16045) The following syntax used to execute tramp shell command: exec <
Hi,

there is a regression introduced by this commit:
=

<= div>e43048325611953396186b569447a3754422dd= c3
Author: Michael Albinu= s <michael.albinus@gmx.de&= gt;
Date: =A0 Fri Dec 6 16:34:06 2013 +01= 00

= =A0 =A0 Bug#16045
=A0 =A0=A0
=A0 =A0 * progmodes/compile.el (compi= lation-start):
=A0 =A0 * = progmodes/grep.el (rgrep): Revert change of 2012-12-20 (r111276).
=A0 =A0=A0
=A0 =A0 * net/tramp-sh.el (tramp-sh-handle-start-file-pr= ocess):
=A0 =A0 Handle lo= ng command lines, lasting from "sh -c ...". =A0(Bug#16045)=

=

=
The following sy= ntax used to execute tramp shell command:
exec <<EOF= /bin/bash
= commands
EO= F
prevents users t= o send inputs to bash using stdin.
For example, the following does not works anymore:<= /div>

exec <<EOF /bin/= bash
read l= ine;
echo $line;
EOF

I don't understand what was this problem of long command lines (Bug#160= 45): I've tried to execute shell comands with huge command lines and al= l were successfull.
To keep the approach of splitting the lines, I would suggest something like= that:
exec= /bin/bash -c "
commands
on=
multiple l= ines
"=

But this needs to back= slash all shell specific characters, and I don't know if there is reall= y benefit compared to the original solution (before <<EOF)

What do you think?

--=A0
Sylva= in

PS: I've a= lready posted on tramp-devel mailing list but it seems there is no activity= there.
--001a113940cab4399304f10f8205-- From debbugs-submit-bounces@debbugs.gnu.org Wed Jan 29 09:35:54 2014 Received: (at 16582) by debbugs.gnu.org; 29 Jan 2014 14:35:55 +0000 Received: from localhost ([127.0.0.1]:40017 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1W8WF8-0008FY-5t for submit@debbugs.gnu.org; Wed, 29 Jan 2014 09:35:54 -0500 Received: from mout.gmx.net ([212.227.17.21]:53034) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1W8WF4-0008FN-HI for 16582@debbugs.gnu.org; Wed, 29 Jan 2014 09:35:51 -0500 Received: from detlef.gmx.de ([93.209.80.17]) by mail.gmx.com (mrgmx003) with ESMTPS (Nemesis) id 0MU1MP-1Vhwof2tu5-00Qkh4 for <16582@debbugs.gnu.org>; Wed, 29 Jan 2014 15:35:49 +0100 From: Michael Albinus To: Sylvain Chouleur Subject: Re: bug#16582: Bug: tramp shell command doesn't read stdin References: Date: Wed, 29 Jan 2014 15:35:45 +0100 In-Reply-To: (Sylvain Chouleur's message of "Tue, 28 Jan 2014 23:40:06 +0100") Message-ID: <87k3di97pa.fsf@gmx.de> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K0:hACJPWWNd+Ky8Lo9wm1S4p6qtaVMTGULwIVOtNGI88cWki47P5B NMSfeHb1dypPrbqRWvaY74Amq226bqx9f/90+mDdz7HIi2A9YpUCuZnejQ3LPALOM8sHMCo T1fX6PzU+P/ZhOPpsSnUsVLRqJC/7/0KRK2WiqOH9wndLygyqkuE3GqYgkP8yShmD4tq1QW v6ys6w0QQ7o8j/6rCh8eA== X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 16582 Cc: 16582@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) Sylvain Chouleur writes: > Hi, Hi Sylvain, > I don't understand what was this problem of long command lines > (Bug#16045): I've tried to execute shell comands with huge command > lines and all were successfull. > To keep the approach of splitting the lines, I would suggest something > like that: > exec /bin/bash -c " > commands > on > multiple lines > " > > But this needs to backslash all shell specific characters, and I don't > know if there is really benefit compared to the original solution > (before < > What do you think? The use case which has triggered the Bug#16045 is rgrep. Run `M-x rgrep' on a remote directory. This issues a command like this (in one line!): find . -type d \( -path \*/SCCS -o -path \*/RCS -o -path \*/CVS -o -path \*/MCVS -o -path \*/.svn -o -path \*/.git -o -path \*/.hg -o -path \*/.bzr -o -path \*/_MTN -o -path \*/_darcs -o -path \*/\{arch\} \) -prune -o \! -type d \( -name .\#\* -o -name \*.o -o -name \*\~ -o -name \*.bin -o -name \*.lbin -o -name \*.so -o -name \*.a -o -name \*.ln -o -name \*.blg -o -name \*.bbl -o -name \*.elc -o -name \*.lof -o -name \*.glo -o -name \*.idx -o -name \*.lot -o -name \*.fmt -o -name \*.tfm -o -name \*.class -o -name \*.fas -o -name \*.lib -o -name \*.mem -o -name \*.x86f -o -name \*.sparcf -o -name \*.dfsl -o -name \*.pfsl -o -name \*.d64fsl -o -name \*.p64fsl -o -name \*.lx64fsl -o -name \*.lx32fsl -o -name \*.dx64fsl -o -name \*.dx32fsl -o -name \*.fx64fsl -o -name \*.fx32fsl -o -name \*.sx64fsl -o -name \*.sx32fsl -o -name \*.wx64fsl -o -name \*.wx32fsl -o -name \*.fasl -o -name \*.ufsl -o -name \*.fsl -o -name \*.dxl -o -name \*.lo -o -name \*.la -o -name \*.gmo -o -name \*.mo -o -name \*.toc -o -name \*.aux -o -name \*.cp -o -name \*.fn -o -name \*.ky -o -name \*.pg -o -name \*.tp -o -name \*.vr -o -name \*.cps -o -name \*.fns -o -name \*.kys -o -name \*.pgs -o -name \*.tps -o -name \*.vrs -o -name \*.pyc -o -name \*.pyo \) -prune -o -type f \( -name \* -o -name .\* \) -exec grep -i -nH -e emacs {} + It didn't work with the previous Tramp command invocation, I could reproduce it locally. The changed command invocation, using a here-document, allows to execute the command. I understand your problem, and I would like to keep the previous command invocation method, but I don't know how to do. Breaking the command into several lines, escaped with "\\\n", doesn't work, because finally the shell interpreter removes those line breaks, and it is confronted with the long line, again. If somebody has a better idea, I would be happy to implement. Best regards, Michael. PS: Sorry for the late reply. I've seen your message on the Tramp ML as well, but I'm too busy just now for answering in short time. From debbugs-submit-bounces@debbugs.gnu.org Sun Feb 02 09:28:01 2014 Received: (at 16582) by debbugs.gnu.org; 2 Feb 2014 14:28:01 +0000 Received: from localhost ([127.0.0.1]:45730 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1W9y1g-0003KI-3o for submit@debbugs.gnu.org; Sun, 02 Feb 2014 09:28:01 -0500 Received: from mail-qc0-f173.google.com ([209.85.216.173]:48970) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1W9y1c-0003K8-Rk for 16582@debbugs.gnu.org; Sun, 02 Feb 2014 09:27:58 -0500 Received: by mail-qc0-f173.google.com with SMTP id i8so9717766qcq.32 for <16582@debbugs.gnu.org>; Sun, 02 Feb 2014 06:27:56 -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=7nbsZ2VSYUh22gyyxXJnWITUKZ0CfeMnhluDj+S5Y18=; b=HDsLjl5R3fannJNeLzic5oAk0FwdSTHZKQOoFgL3fjQSCuQjGiOmygP4oromSXyzxG hF6TFLMEkKNbTlP9pGYmM2V5teupMId/qB+BTX/A8gOgRDk87531Q6vvUN+kQCl0bhaQ bzxygmT0bwyGNKmbK1tIIxe4rxwgV+hcrSQAUfPU/JBbLsn+Db3xir0lS1U5K4SbLbU+ I2LhmQpWXFNtozsH4j0cdh9aI3KDxN98x8VfNoWjaBlFsiSKBVSP80Ga/OMKa0UlStD4 KH7R97PX2CST53v651u+MOw67DIMBn/K4K+jp2P3a7M85rcRPxl0Laxex6J4QCjYIGqE N8Cw== X-Received: by 10.224.34.71 with SMTP id k7mr48438947qad.15.1391351276045; Sun, 02 Feb 2014 06:27:56 -0800 (PST) MIME-Version: 1.0 Received: by 10.96.63.134 with HTTP; Sun, 2 Feb 2014 06:27:35 -0800 (PST) In-Reply-To: <87k3di97pa.fsf@gmx.de> References: <87k3di97pa.fsf@gmx.de> From: Sylvain Chouleur Date: Sun, 2 Feb 2014 15:27:35 +0100 Message-ID: Subject: Re: bug#16582: Bug: tramp shell command doesn't read stdin To: Michael Albinus Content-Type: multipart/mixed; boundary=001a11c291e6911c1404f16d369c X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 16582 Cc: 16582@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) --001a11c291e6911c1404f16d369c Content-Type: multipart/alternative; boundary=001a11c291e6911c0c04f16d369a --001a11c291e6911c0c04f16d369a Content-Type: text/plain; charset=ISO-8859-1 Hi, Here is my proposal (patch in attachment) exec env PS1=.. bash <(cat <<'EOF' heredoc commands EOF ) bash is still reading stdin and long lines seems to work. Try it and let me know if any problems -- Sylvain 2014-01-29 Michael Albinus : > Sylvain Chouleur writes: > > > Hi, > > Hi Sylvain, > > > I don't understand what was this problem of long command lines > > (Bug#16045): I've tried to execute shell comands with huge command > > lines and all were successfull. > > To keep the approach of splitting the lines, I would suggest something > > like that: > > exec /bin/bash -c " > > commands > > on > > multiple lines > > " > > > > But this needs to backslash all shell specific characters, and I don't > > know if there is really benefit compared to the original solution > > (before < > > > What do you think? > > The use case which has triggered the Bug#16045 is rgrep. Run `M-x rgrep' > on a remote directory. This issues a command like this (in one line!): > > find . -type d \( -path \*/SCCS -o -path \*/RCS -o -path \*/CVS -o -path > \*/MCVS -o -path \*/.svn -o -path \*/.git -o -path \*/.hg -o -path > \*/.bzr -o -path \*/_MTN -o -path \*/_darcs -o -path \*/\{arch\} \) > -prune -o \! -type d \( -name .\#\* -o -name \*.o -o -name \*\~ -o -name > \*.bin -o -name \*.lbin -o -name \*.so -o -name \*.a -o -name \*.ln -o > -name \*.blg -o -name \*.bbl -o -name \*.elc -o -name \*.lof -o -name > \*.glo -o -name \*.idx -o -name \*.lot -o -name \*.fmt -o -name \*.tfm > -o -name \*.class -o -name \*.fas -o -name \*.lib -o -name \*.mem -o > -name \*.x86f -o -name \*.sparcf -o -name \*.dfsl -o -name \*.pfsl -o > -name \*.d64fsl -o -name \*.p64fsl -o -name \*.lx64fsl -o -name > \*.lx32fsl -o -name \*.dx64fsl -o -name \*.dx32fsl -o -name \*.fx64fsl > -o -name \*.fx32fsl -o -name \*.sx64fsl -o -name \*.sx32fsl -o -name > \*.wx64fsl -o -name \*.wx32fsl -o -name \*.fasl -o -name \*.ufsl -o > -name \*.fsl -o -name \*.dxl -o -name \*.lo -o -name \*.la -o -name > \*.gmo -o -name \*.mo -o -name \*.toc -o -name \*.aux -o -name \*.cp -o > -name \*.fn -o -name \*.ky -o -name \*.pg -o -name \*.tp -o -name \*.vr > -o -name \*.cps -o -name \*.fns -o -name \*.kys -o -name \*.pgs -o -name > \*.tps -o -name \*.vrs -o -name \*.pyc -o -name \*.pyo \) -prune -o > -type f \( -name \* -o -name .\* \) -exec grep -i -nH -e emacs {} + > > It didn't work with the previous Tramp command invocation, I could > reproduce it locally. The changed command invocation, using a > here-document, allows to execute the command. > > I understand your problem, and I would like to keep the previous command > invocation method, but I don't know how to do. Breaking the command into > several lines, escaped with "\\\n", doesn't work, because finally the > shell interpreter removes those line breaks, and it is confronted with > the long line, again. > > If somebody has a better idea, I would be happy to implement. > > Best regards, Michael. > > PS: Sorry for the late reply. I've seen your message on the Tramp ML as > well, but I'm too busy just now for answering in short time. > --001a11c291e6911c0c04f16d369a Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
Hi,

Here is my proposal (patch in attac= hment)

exec env PS1=3D.. bash <(cat <<= 9;EOF'
heredoc commands
EOF
)
<= br>
bash is still reading stdin and long lines seems to work.
<= div>Try it and let me know if any problems

--=A0
Sylvain


2014-01-29 Michael Albinus <michael.albinus@gmx.de>:
Sylvain Chouleur <sylvain.= chouleur@gmail.com> writes:

> Hi,

Hi Sylvain,

> I don't understand what was this problem of long command lines
> (Bug#16045): I've tried to execute shell comands with huge command=
> lines and all were successfull.
> To keep the approach of splitting the lines, I would suggest something=
> like that:
> exec /bin/bash -c "
> commands
> on
> multiple lines
> "
>
> But this needs to backslash all shell specific characters, and I don&#= 39;t
> know if there is really benefit compared to the original solution
> (before <<EOF)
>
> What do you think?

The use case which has triggered the Bug#16045 is rgrep. Run `M-x rgr= ep'
on a remote directory. This issues a command like this (in one line!):

find . -type d \( -path \*/SCCS -o -path \*/RCS -o -path \*/CVS -o -path \*/MCVS -o -path \*/.svn -o -path \*/.git -o -path \*/.hg -o -path
\*/.bzr -o -path \*/_MTN -o -path \*/_darcs -o -path \*/\{arch\} \)
-prune -o \! -type d \( -name .\#\* -o -name \*.o -o -name \*\~ -o -name \*.bin -o -name \*.lbin -o -name \*.so -o -name \*.a -o -name \*.ln -o
-name \*.blg -o -name \*.bbl -o -name \*.elc -o -name \*.lof -o -name
\*.glo -o -name \*.idx -o -name \*.lot -o -name \*.fmt -o -name \*.tfm
-o -name \*.class -o -name \*.fas -o -name \*.lib -o -name \*.mem -o
-name \*.x86f -o -name \*.sparcf -o -name \*.dfsl -o -name \*.pfsl -o
-name \*.d64fsl -o -name \*.p64fsl -o -name \*.lx64fsl -o -name
\*.lx32fsl -o -name \*.dx64fsl -o -name \*.dx32fsl -o -name \*.fx64fsl
-o -name \*.fx32fsl -o -name \*.sx64fsl -o -name \*.sx32fsl -o -name
\*.wx64fsl -o -name \*.wx32fsl -o -name \*.fasl -o -name \*.ufsl -o
-name \*.fsl -o -name \*.dxl -o -name \*.lo -o -name \*.la -o -name
\*.gmo -o -name \*.mo -o -name \*.toc -o -name \*.aux -o -name \*.cp -o
-name \*.fn -o -name \*.ky -o -name \*.pg -o -name \*.tp -o -name \*.vr
-o -name \*.cps -o -name \*.fns -o -name \*.kys -o -name \*.pgs -o -name \*.tps -o -name \*.vrs -o -name \*.pyc -o -name \*.pyo \) -prune -o
-type f \( -name \* -o -name .\* \) -exec grep -i -nH -e emacs {} +

It didn't work with the previous Tramp command invocation, I could
reproduce it locally. The changed command invocation, using a
here-document, allows to execute the command.

I understand your problem, and I would like to keep the previous command invocation method, but I don't know how to do. Breaking the command int= o
several lines, escaped with "\\\n", doesn't work, because fin= ally the
shell interpreter removes those line breaks, and it is confronted with
the long line, again.

If somebody has a better idea, I would be happy to implement.

Best regards, Michael.

PS: Sorry for the late reply. I've seen your message on the Tramp ML as=
well, but I'm too busy just now for answering in short time.

--001a11c291e6911c0c04f16d369a-- --001a11c291e6911c1404f16d369c Content-Type: text/x-patch; charset=US-ASCII; name="0001-Fix-tramp-sh-handle-start-file-process-stdin.patch" Content-Disposition: attachment; filename="0001-Fix-tramp-sh-handle-start-file-process-stdin.patch" Content-Transfer-Encoding: base64 X-Attachment-Id: f_hr6elwlt0 RnJvbSAyYjllMjhlMmU0NTNhMDY4ZWI4ODk4ZmI4M2QxZDcxMDA4ZmRmM2ZmIE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBTeWx2YWluIENob3VsZXVyIDxzeWx2YWluLmNob3VsZXVyQGdt YWlsLmNvbT4KRGF0ZTogRnJpLCAyNCBKYW4gMjAxNCAxNzo0NjowNiArMDEwMApTdWJqZWN0OiBb UEFUQ0hdIEZpeCB0cmFtcC1zaC1oYW5kbGUtc3RhcnQtZmlsZS1wcm9jZXNzIHN0ZGluCgoqIG5l dC90cmFtcC1zaC5lbCAodHJhbXAtc2gtaGFuZGxlLXN0YXJ0LWZpbGUtcHJvY2Vzcyk6ClRoZSBo ZXJlZG9jIHNvbHV0aW9uIHRobyBoYW5kbGUgbG9uZyBjb21tYW5kIGxpbmVzIHByZXZlbnQgdGhl IHVzZXIgdG8KcGFzcyBzb21lIGlucHV0IHRvIHRoZSBwcm9ncmFtIHVzaW5nIHN0ZGluLgpVc2Ug YSBjb3Byb2MgdG8gcGFzcyB0aGUgaGVyZWRvYyBjb21tYW5kIHRvIHRoZSBzaGVsbAphbmQgcHJl c2VydmVkIHN0ZGluIGZvciB1c2VyIGlucHV0LgotLS0KIGxpc3AvbmV0L3RyYW1wLXNoLmVsIHwg NyArKystLS0tCiAxIGZpbGUgY2hhbmdlZCwgMyBpbnNlcnRpb25zKCspLCA0IGRlbGV0aW9ucygt KQoKZGlmZiAtLWdpdCBhL2xpc3AvbmV0L3RyYW1wLXNoLmVsIGIvbGlzcC9uZXQvdHJhbXAtc2gu ZWwKaW5kZXggNjVkNWYyN2U5NjdjLi4zZjRmMmJmNzdkN2IgMTAwNjQ0Ci0tLSBhL2xpc3AvbmV0 L3RyYW1wLXNoLmVsCisrKyBiL2xpc3AvbmV0L3RyYW1wLXNoLmVsCkBAIC0yNzA1LDE2ICsyNzA1 LDE1IEBAIHRoZSByZXN1bHQgd2lsbCBiZSBhIGxvY2FsLCBub24tVHJhbXAsIGZpbGVuYW1lLiIK IAkJICAgKGNkciBhcmdzKSkpCiAJICAgKGNvbW1hbmQKIAkgICAgKHdoZW4gKHN0cmluZ3AgcHJv Z3JhbSkKLQkgICAgICAoZm9ybWF0ICJjZCAlczsgZXhlYyAlcyBlbnYgUFMxPSVzICVzIgorCSAg ICAgIChmb3JtYXQgImNkICVzOyBleGVjIGVudiBQUzE9JXMgJXMiCiAJCSAgICAgICh0cmFtcC1z aGVsbC1xdW90ZS1hcmd1bWVudCBsb2NhbG5hbWUpCi0JCSAgICAgIChpZiBoZXJlZG9jICI8PEVP RiIgIiIpCiAJCSAgICAgIDs7IFVzZSBhIGh1bWFuLWZyaWVuZGx5IHByb21wdCwgZm9yIGV4YW1w bGUgZm9yIGBzaGVsbCcuCiAJCSAgICAgICh0cmFtcC1zaGVsbC1xdW90ZS1hcmd1bWVudAogCQkg ICAgICAgKGZvcm1hdCAiJXMgJXMiCiAJCQkgICAgICAgKGZpbGUtcmVtb3RlLXAgZGVmYXVsdC1k aXJlY3RvcnkpCiAJCQkgICAgICAgdHJhbXAtaW5pdGlhbC1lbmQtb2Ytb3V0cHV0KSkKIAkJICAg ICAgKGlmIGhlcmVkb2MKLQkJCSAgKGZvcm1hdCAiJXNcbiVzXG5FT0YiIHByb2dyYW0gKGNhciBh cmdzKSkKKwkJCSAgKGZvcm1hdCAiJXMgPChjYXQgPDwnRU9GJ1xuJXNcbkVPRlxuKSIgcHJvZ3Jh bSAoY2FyIGFyZ3MpKQogCQkJKG1hcGNvbmNhdCAndHJhbXAtc2hlbGwtcXVvdGUtYXJndW1lbnQK IAkJCQkgICAoY29ucyBwcm9ncmFtIGFyZ3MpICIgIikpKSkpCiAJICAgKHRyYW1wLXByb2Nlc3Mt Y29ubmVjdGlvbi10eXBlCkBAIC00NTYxLDcgKzQ1NjAsNyBAQCBmdW5jdGlvbiB3YWl0cyBmb3Ig b3V0cHV0IHVubGVzcyBOT09VVFBVVCBpcyBzZXQuIgogICAgIDs7IGZvbGxvd2luZyBzeW50YXgg Zm9yIGhlcmUtZG9jdW1lbnRzLiAgVGhpcyB3ZSBjYW5ub3QgdGVzdDsgaXQKICAgICA7OyBzaGFs bCBiZSBzZXQgdmlhIGB0cmFtcC1jb25uZWN0aW9uLXByb3BlcnRpZXMnLgogICAgICh3aGVuIChh bmQgKHN0cmluZy1tYXRjaCAiPDwnRU9GJyIgY29tbWFuZCkKLQkgICAgICAgKG5vdCAodHJhbXAt Z2V0LWNvbm5lY3Rpb24tcHJvcGVydHkgdmVjICJidXN5Ym94IiBuaWwpKSkKKwkgICAgICAgKHRy YW1wLWdldC1jb25uZWN0aW9uLXByb3BlcnR5IHZlYyAiYnVzeWJveCIgbmlsKSkKICAgICAgIDs7 IFVuc2V0ICRQUzEgd2hlbiB1c2luZyBoZXJlIGRvY3VtZW50cywgaW4gb3JkZXIgdG8gYXZvaWQK ICAgICAgIDs7IG11bHRpcGxlIHByb21wdHMuCiAgICAgICAoc2V0cSBjb21tYW5kIChjb25jYXQg IihQUzE9IDsgIiBjb21tYW5kICJcbikiKSkpCi0tIAoxLjguNS4yCgo= --001a11c291e6911c1404f16d369c-- From debbugs-submit-bounces@debbugs.gnu.org Mon Feb 03 07:53:45 2014 Received: (at 16582) by debbugs.gnu.org; 3 Feb 2014 12:53:45 +0000 Received: from localhost ([127.0.0.1]:47448 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WAJ20-0000tD-EN for submit@debbugs.gnu.org; Mon, 03 Feb 2014 07:53:44 -0500 Received: from mout.gmx.net ([212.227.17.21]:53729) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WAJ1w-0000t3-Pr for 16582@debbugs.gnu.org; Mon, 03 Feb 2014 07:53:42 -0500 Received: from detlef.gmx.de ([93.209.88.154]) by mail.gmx.com (mrgmx102) with ESMTPS (Nemesis) id 0LZlZ2-1VOv4I1vv2-00lTZg for <16582@debbugs.gnu.org>; Mon, 03 Feb 2014 13:53:39 +0100 From: Michael Albinus To: Sylvain Chouleur Subject: Re: bug#16582: Bug: tramp shell command doesn't read stdin References: <87k3di97pa.fsf@gmx.de> Date: Mon, 03 Feb 2014 13:53:36 +0100 In-Reply-To: (Sylvain Chouleur's message of "Sun, 2 Feb 2014 15:27:35 +0100") Message-ID: <87eh3k5pdb.fsf@gmx.de> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Provags-ID: V03:K0:+2xXt6Y4PF4yoQr3e7ILbK91ypgbWA3vi3OmrYSfw/f0KPJjeq1 Q7UXwxdujZ7WZrxNL6+qfnxy0P6TEfr6cW6qEWDWP4uYAA+NWu5eOZCOVO2LBVlhKnXedUT 3cMGDxYNQTb2oCVfHvH3kLIWK72rGifDvkJJohNtT7KZLSkOvZbWk+WzpSlZMmZfQbZmQpk gIIftRaDiA4nV7HP7xPcA== X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 16582 Cc: 16582@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) --=-=-= Content-Type: text/plain Sylvain Chouleur writes: > Hi, Hi Sylvain, > Here is my proposal (patch in attachment) > > exec env PS1=.. bash <(cat <<'EOF' > heredoc commands > EOF > ) Thanks for this. However, I'm not sure whether all bourne shell derivates support process substitution <(). What if Tramp uses another heredoc delimeter but 'EOF'? I've appended a respective patch; could you, please, check? If it doesn't work for you, please set tramp-verbose to 6, and rerun your test. I would like to see the Tramp debug buffer then. Explain also, what you have invoked, and how. Best regards, Michael. --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=diff diff --git a/lisp/tramp-sh.el b/lisp/tramp-sh.el index 65d5f27..67a517a 100644 --- a/lisp/tramp-sh.el +++ b/lisp/tramp-sh.el @@ -79,6 +79,9 @@ detected as prompt when being sent on echoing hosts, therefore.") (defconst tramp-initial-end-of-output "#$ " "Prompt when establishing a connection.") +(defconst tramp-end-of-heredoc (md5 tramp-end-of-output) + "String used to recognize end of heredoc strings.") + ;; Initialize `tramp-methods' with the supported methods. ;;;###tramp-autoload (add-to-list 'tramp-methods @@ -1443,8 +1446,11 @@ be non-negative integers." (if (and (stringp acl-string) (tramp-remote-acl-p v) (progn (tramp-send-command - v (format "setfacl --set-file=- %s <<'EOF'\n%s\nEOF\n" - (tramp-shell-quote-argument localname) acl-string)) + v (format "setfacl --set-file=- %s <<'%s'\n%s\n%s\n" + (tramp-shell-quote-argument localname) + tramp-end-of-heredoc + acl-string + tramp-end-of-heredoc)) (tramp-send-command-and-check v nil))) ;; Success. (progn @@ -2707,14 +2713,15 @@ the result will be a local, non-Tramp, filename." (when (stringp program) (format "cd %s; exec %s env PS1=%s %s" (tramp-shell-quote-argument localname) - (if heredoc "<) id 1WAosH-0002e4-Uj for submit@debbugs.gnu.org; Tue, 04 Feb 2014 17:53:50 -0500 Received: from mail-qa0-f51.google.com ([209.85.216.51]:48319) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WAosF-0002dv-ED for 16582@debbugs.gnu.org; Tue, 04 Feb 2014 17:53:48 -0500 Received: by mail-qa0-f51.google.com with SMTP id f11so13221613qae.38 for <16582@debbugs.gnu.org>; Tue, 04 Feb 2014 14:53:46 -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=uVAxKbJk/qc2VYJJ+eXQzJAMuekMtd5Q5oLmxp4/KNY=; b=jAkN4i3WLAoXz60Dy/o6gbJb65OQSR//eRji+eUEusP/VvZy4ioww34+moGJXSvhQ+ orn+y0AV7DwN/N2TcDiJG89eh3K5HpcFrF1IDnnYrHsf1QLC9L1yxzpf6GkefeMdOSz6 m4quCPlOQRPH6Xau0ZheA5qU6QuJe/7JdLOBZcQunwoHKZXmGROY/F4I6/lNzIs+m08z JQGHgGUZCqxDqTb4usBFGmTtwz9h0wQ2CL2JN4uGZmv+cXGYljAA3fxX+v8RAPSQr7oK eyOM6pQzgtA9Pz1BfPZO4xE15VanXYCPoauHyPj5QHYt6Rxr7X5Q6+v8bt2ytPxWzUdS umXQ== X-Received: by 10.224.34.71 with SMTP id k7mr71000340qad.15.1391554426623; Tue, 04 Feb 2014 14:53:46 -0800 (PST) MIME-Version: 1.0 Received: by 10.96.63.134 with HTTP; Tue, 4 Feb 2014 14:53:26 -0800 (PST) In-Reply-To: <87eh3k5pdb.fsf@gmx.de> References: <87k3di97pa.fsf@gmx.de> <87eh3k5pdb.fsf@gmx.de> From: Sylvain Chouleur Date: Tue, 4 Feb 2014 23:53:26 +0100 Message-ID: Subject: Re: bug#16582: Bug: tramp shell command doesn't read stdin To: Michael Albinus Content-Type: multipart/alternative; boundary=001a11c291e648dad304f19c8323 X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 16582 Cc: 16582@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) --001a11c291e648dad304f19c8323 Content-Type: text/plain; charset=ISO-8859-1 Hi Michael, replacing EOF delimiter by a md5sum works well. 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 <: > Sylvain Chouleur writes: > > > Hi, > > Hi Sylvain, > > > Here is my proposal (patch in attachment) > > > > exec env PS1=.. bash <(cat <<'EOF' > > heredoc commands > > EOF > > ) > > Thanks for this. However, I'm not sure whether all bourne shell > derivates support process substitution <(). > > What if Tramp uses another heredoc delimeter but 'EOF'? I've appended a > respective patch; could you, please, check? > > If it doesn't work for you, please set tramp-verbose to 6, and rerun > your test. I would like to see the Tramp debug buffer then. Explain > also, what you have invoked, and how. > > Best regards, Michael. > > --001a11c291e648dad304f19c8323 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
Hi Michael,

replacing EOF delimiter by = a md5sum works well.

The process substitution work= s only for real bash shells, or zsh.
It does not work with sh or = busybox.

So I think we have two solutions here:
=A0- S= upport multiple methods, chosen by user configuration:
=A0 =A0-&g= t; bash -c "cmd" which doesn't support very long commands
=A0 =A0-> bash <<EOF which doesn't support stdin
=A0 =A0-> bash <(cat <<EOF) which supports all but which does= n't works on basic shells like sh or busybox (works with bash and zsh)<= /div>
=A0- Reproduce method 3 by writting commands in a target's tempora= ry file, launch the shell with this file in argument, and finally remove th= e 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

Cheers,
--=A0
Sylvain


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

> Hi,

Hi Sylvain,

> Here is my proposal (patch in attachment)
>
> exec env PS1=3D.. bash <(cat <<'EOF'
> heredoc commands
> EOF
> )

Thanks for this. However, I'm not sure whether all bourne shell derivates support process substitution <().

What if Tramp uses another heredoc delimeter but 'EOF'? I've ap= pended a
respective patch; could you, please, check?

If it doesn't work for you, please set tramp-verbose to 6, and rerun your test. I would like to see the Tramp debug buffer then. Explain
also, what you have invoked, and how.

Best regards, Michael.


--001a11c291e648dad304f19c8323-- From debbugs-submit-bounces@debbugs.gnu.org Wed Feb 05 03:29:17 2014 Received: (at 16582) by debbugs.gnu.org; 5 Feb 2014 08:29:17 +0000 Received: from localhost ([127.0.0.1]:50120 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WAxrB-0003eV-F2 for submit@debbugs.gnu.org; Wed, 05 Feb 2014 03:29:17 -0500 Received: from mout.gmx.net ([212.227.15.19]:62085) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WAxr9-0003eN-Ed for 16582@debbugs.gnu.org; Wed, 05 Feb 2014 03:29:16 -0500 Received: from detlef.gmx.de ([93.209.68.221]) by mail.gmx.com (mrgmx001) with ESMTPS (Nemesis) id 0LmrUq-1VaW6X3FIS-00h9HR for <16582@debbugs.gnu.org>; Wed, 05 Feb 2014 09:29:14 +0100 From: Michael Albinus To: Sylvain Chouleur Subject: Re: bug#16582: Bug: tramp shell command doesn't read stdin References: <87k3di97pa.fsf@gmx.de> <87eh3k5pdb.fsf@gmx.de> Date: Wed, 05 Feb 2014 09:29:10 +0100 In-Reply-To: (Sylvain Chouleur's message of "Tue, 4 Feb 2014 23:53:26 +0100") Message-ID: <87zjm6rmi1.fsf@gmx.de> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K0:zMWd7g2b59yJQ4t4RPjTwYIUpXZhEkcqoKmwkBIc7PE2VnXFqD0 hS2Wimk18KgcvmAbahcoV+KudBhFVzKb6a3regK1v9S3aKoAQPoobrwQLTjX47Eb/m3gASK Yeqyh3KZUblXf/auW5pEhy2rAbuBXkCjrg2G3xxT1eMNhpalVGkZr00SRa4LHnD9MGuO8Am Jf2nEPPJstTVurF5wfmIQ== X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 16582 Cc: 16582@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) 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. From debbugs-submit-bounces@debbugs.gnu.org Wed Feb 05 04:44:28 2014 Received: (at 16582) by debbugs.gnu.org; 5 Feb 2014 09:44:29 +0000 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 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 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) MIME-Version: 1.0 Received: by 10.96.63.134 with HTTP; Wed, 5 Feb 2014 01:44:03 -0800 (PST) In-Reply-To: <87zjm6rmi1.fsf@gmx.de> References: <87k3di97pa.fsf@gmx.de> <87eh3k5pdb.fsf@gmx.de> <87zjm6rmi1.fsf@gmx.de> From: Sylvain Chouleur Date: Wed, 5 Feb 2014 10:44:03 +0100 Message-ID: Subject: Re: bug#16582: Bug: tramp shell command doesn't read stdin To: Michael Albinus Content-Type: multipart/alternative; boundary=001a113940ca14653804f1a59a52 X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 16582 Cc: 16582@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) --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-- From debbugs-submit-bounces@debbugs.gnu.org Wed Feb 05 05:27:35 2014 Received: (at 16582) by debbugs.gnu.org; 5 Feb 2014 10:27:35 +0000 Received: from localhost ([127.0.0.1]:50201 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WAzhf-0007oB-0U for submit@debbugs.gnu.org; Wed, 05 Feb 2014 05:27:35 -0500 Received: from mout.gmx.net ([212.227.15.19]:58243) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WAzhb-0007o1-LP for 16582@debbugs.gnu.org; Wed, 05 Feb 2014 05:27:32 -0500 Received: from detlef.gmx.de ([93.209.68.221]) by mail.gmx.com (mrgmx101) with ESMTPS (Nemesis) id 0M3vCA-1VJqux2wOQ-00rYNq for <16582@debbugs.gnu.org>; Wed, 05 Feb 2014 11:27:30 +0100 From: Michael Albinus To: Sylvain Chouleur Subject: Re: bug#16582: Bug: tramp shell command doesn't read stdin References: <87k3di97pa.fsf@gmx.de> <87eh3k5pdb.fsf@gmx.de> <87zjm6rmi1.fsf@gmx.de> Date: Wed, 05 Feb 2014 11:27:26 +0100 In-Reply-To: (Sylvain Chouleur's message of "Wed, 5 Feb 2014 10:44:03 +0100") Message-ID: <87r47hsvld.fsf@gmx.de> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K0:XY8eI7GSt+uqBFHMFfz6ROJzrg+NS86npv7dwHFPdJutOhSHl+z Lm+mol72gQqUzYCk50C5AN16QIQ1VPQhewLxXKdBr9iVSJ2Vrz7f+Pl/8MBN+tD400AEyDE 1DtJr4p8sc9CwK297aFNGL38aT325mkjz0m7/9+/0TStSxym5RblIO9wZ1tDkgJYy0cTh6j RTUsZdZExwbtNJ/TdKtvQ== X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 16582 Cc: 16582@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) Sylvain Chouleur writes: > 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) Please give me a concrete Lisp example how you invoke this. Otherwise I cannot debug; my examples do work. Alternatively, tell me what you have entered, starting with "M-x". Best regards, Michael. From debbugs-submit-bounces@debbugs.gnu.org Wed Feb 05 07:27:41 2014 Received: (at 16582) by debbugs.gnu.org; 5 Feb 2014 12:27:41 +0000 Received: from localhost ([127.0.0.1]:50274 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WB1Zs-0002UP-HT for submit@debbugs.gnu.org; Wed, 05 Feb 2014 07:27:40 -0500 Received: from mail-qa0-f53.google.com ([209.85.216.53]:50329) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WB1Zq-0002UH-A2 for 16582@debbugs.gnu.org; Wed, 05 Feb 2014 07:27:38 -0500 Received: by mail-qa0-f53.google.com with SMTP id cm18so397019qab.12 for <16582@debbugs.gnu.org>; Wed, 05 Feb 2014 04:27:37 -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=FpB9Y2i6hFNX0T1Gmb1Hjn5aaPSGkedjJnd72jSKkkc=; b=Pe1DXfbIkeNLyTt7hojfXsnX9T0sjY9qqb2t3TigHauzmiLapbhbpsD0jsphG4UCXh NS/XsrYqUdUxlYXCQQ9odqKLtlHUWoxsX4l46FdXfZv36zrXgxpRqsZPcN2BLyLqNNTI NnuDZD1Cq8Bec2FW9BeQ5wgyiLTlJkXwIeGrTMq7dkabZ3o6lhlw0/tDnDdtOvvOa5+X yWlczC7thCRC5UFksu1zgDWJ8lulptcUnDF0cU5vr4QI4YKcXVMwGNl8BpI6KB+DAW93 f+rE/qTtL+hMPxK50LbskPStQMBLqvQvB6BMD1xznmPwEdZ5K+1SRdCrrIrA5YGlHvyU fwzw== X-Received: by 10.140.105.35 with SMTP id b32mr1909526qgf.36.1391603257877; Wed, 05 Feb 2014 04:27:37 -0800 (PST) MIME-Version: 1.0 Received: by 10.96.63.134 with HTTP; Wed, 5 Feb 2014 04:27:17 -0800 (PST) In-Reply-To: <87r47hsvld.fsf@gmx.de> References: <87k3di97pa.fsf@gmx.de> <87eh3k5pdb.fsf@gmx.de> <87zjm6rmi1.fsf@gmx.de> <87r47hsvld.fsf@gmx.de> From: Sylvain Chouleur Date: Wed, 5 Feb 2014 13:27:17 +0100 Message-ID: Subject: Re: bug#16582: Bug: tramp shell command doesn't read stdin To: Michael Albinus Content-Type: multipart/alternative; boundary=001a113940cadaa94704f1a7e133 X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 16582 Cc: 16582@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) --001a113940cadaa94704f1a7e133 Content-Type: text/plain; charset=ISO-8859-1 Go into a tramp buffer, then execute: (async-shell-command "echo -n \"Type something:\"; read line; echo line=$line" nil nil) Your command will print: Type something:line= and terminate. It should have printed Type something: waited for your keyboard input and print: line= 2014-02-05 Michael Albinus : > Sylvain Chouleur writes: > > > 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) > > Please give me a concrete Lisp example how you invoke this. Otherwise I > cannot debug; my examples do work. > > Alternatively, tell me what you have entered, starting with "M-x". > > Best regards, Michael. > --001a113940cadaa94704f1a7e133 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
Go into a tramp buffer, then execute:
(async-shell-com= mand "echo -n \"Type something:\"; read line; echo line=3D$l= ine" nil nil)

Your command will pri= nt:

Type something:line=3D

=
and terminate.
It should have printed

Type something:

waited for your keyboard input and print:

line=3D<your keyboard input>



2014-0= 2-05 Michael Albinus <michael.albinus@gmx.de>:
Sylvain Chouleur <sylvain.chouleur@gmail.com>= writes:

> 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 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 (l= ong
> line arguments) and my problem (bash stdin)

Please give me a concrete Lisp example how you invoke this. Otherwise= I
cannot debug; my examples do work.

Alternatively, tell me what you have entered, starting with "M-x"= .

Best regards, Michael.

--001a113940cadaa94704f1a7e133-- From debbugs-submit-bounces@debbugs.gnu.org Wed Feb 05 09:04:41 2014 Received: (at 16582) by debbugs.gnu.org; 5 Feb 2014 14:04:41 +0000 Received: from localhost ([127.0.0.1]:50316 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WB35k-00068Z-TE for submit@debbugs.gnu.org; Wed, 05 Feb 2014 09:04:41 -0500 Received: from mout.gmx.net ([212.227.17.20]:57095) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WB35i-00068R-Jz for 16582@debbugs.gnu.org; Wed, 05 Feb 2014 09:04:39 -0500 Received: from detlef.gmx.de ([93.209.68.221]) by mail.gmx.com (mrgmx101) with ESMTPS (Nemesis) id 0MKLeM-1WBb3T0L70-001gVw for <16582@debbugs.gnu.org>; Wed, 05 Feb 2014 15:04:37 +0100 From: Michael Albinus To: Sylvain Chouleur Subject: Re: bug#16582: Bug: tramp shell command doesn't read stdin References: <87k3di97pa.fsf@gmx.de> <87eh3k5pdb.fsf@gmx.de> <87zjm6rmi1.fsf@gmx.de> <87r47hsvld.fsf@gmx.de> Date: Wed, 05 Feb 2014 15:04:33 +0100 In-Reply-To: (Sylvain Chouleur's message of "Wed, 5 Feb 2014 13:27:17 +0100") Message-ID: <87lhxpslji.fsf@gmx.de> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K0:DPhZ0cUiyDxkHP6IIL9aH84L4eK7aZ20Y3dx7L1PHEcETIaFOTr +8xQ5iZim4N3p93LUKjM95oTbKCbwzHQ0JG3xTRJCvT13gvhdIZ+bIbQb9Lfg5Lsz+beM+9 b+pc8r5sWYu/rYlnaeenvQJSD8syXk7E04qcwCec2ngKjOUBZq9ofXYhEIZrreiZ/6TIMAN YdzLCSJxW/cLHRMPPzhsg== X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 16582 Cc: 16582@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) Sylvain Chouleur writes: > Go into a tramp buffer, then execute: > (async-shell-command "echo -n \"Type something:\"; read line; echo > line=$line" nil nil) > > Your command will print: > > Type something:line= > > and terminate. Well, the problem is that the heredoc construct occupies STDIN, which is not available for the shell command then. I will check what I can do. Best regards, Michael. From debbugs-submit-bounces@debbugs.gnu.org Wed Feb 05 09:44:39 2014 Received: (at 16582) by debbugs.gnu.org; 5 Feb 2014 14:44:40 +0000 Received: from localhost ([127.0.0.1]:50322 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WB3iR-00075x-4l for submit@debbugs.gnu.org; Wed, 05 Feb 2014 09:44:39 -0500 Received: from mail-qa0-f44.google.com ([209.85.216.44]:38834) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WB3iN-00075n-1J for 16582@debbugs.gnu.org; Wed, 05 Feb 2014 09:44:35 -0500 Received: by mail-qa0-f44.google.com with SMTP id w5so647092qac.31 for <16582@debbugs.gnu.org>; Wed, 05 Feb 2014 06:44:34 -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=EQlPGLxEaihI/O6tZEZmTp5oXBGFhWUaYnC8p2I6c4Q=; b=MhCTdyqgfIJdQ0MeehaYKe248cfNSiEZJPqxmWktYPoijYP7IVDtkv+pKY/NY8RGvK ciZ43Q4x+Hwol6pRqRlhbdA+EHTP3UmEBcYShpynKLt5/V5yraISqN/4RNMDZVV4JvFT WNv1erzyHkYRCQfm7bcgEX+3Asm5wwB1WHbuYmuMOo6N34qjZEbgjN5/o9j8wNRnrRkt zhFCm53gAdSTxeywsochHPffKUHHEPS87hWJByy+XS6PfD8mhl3VnHuqARJPcRbzixaQ 1L+wkCgA1VCFOpOfi58MvxMnfO3348AZeJukm7HWbIUdq61wUo478AbZLviNGvnhNc4N ujDA== X-Received: by 10.229.84.198 with SMTP id k6mr3191189qcl.20.1391611474488; Wed, 05 Feb 2014 06:44:34 -0800 (PST) MIME-Version: 1.0 Received: by 10.96.63.134 with HTTP; Wed, 5 Feb 2014 06:44:14 -0800 (PST) In-Reply-To: <87lhxpslji.fsf@gmx.de> References: <87k3di97pa.fsf@gmx.de> <87eh3k5pdb.fsf@gmx.de> <87zjm6rmi1.fsf@gmx.de> <87r47hsvld.fsf@gmx.de> <87lhxpslji.fsf@gmx.de> From: Sylvain Chouleur Date: Wed, 5 Feb 2014 15:44:14 +0100 Message-ID: Subject: Re: bug#16582: Bug: tramp shell command doesn't read stdin To: Michael Albinus Content-Type: multipart/alternative; boundary=001a1134541a9a327004f1a9cbc2 X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 16582 Cc: 16582@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) --001a1134541a9a327004f1a9cbc2 Content-Type: text/plain; charset=ISO-8859-1 Yes, that is the problem I'm trying to explain since the beginning, I'm please we have finally agreed on what was the issue :) I didn't found any other solution than to call the shell like this: bash With containing the commands. With that type of call, bash keeps reading STDIN for user inputs. That's why I've introduced the process substitution solution 2014-02-05 Michael Albinus : > Sylvain Chouleur writes: > > > Go into a tramp buffer, then execute: > > (async-shell-command "echo -n \"Type something:\"; read line; echo > > line=$line" nil nil) > > > > Your command will print: > > > > Type something:line= > > > > and terminate. > > Well, the problem is that the heredoc construct occupies STDIN, which is > not available for the shell command then. I will check what I can do. > > Best regards, Michael. > --001a1134541a9a327004f1a9cbc2 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
Yes, that is the problem I'm trying to explain since t= he beginning, I'm please we have finally agreed on what was the issue := )

I didn't found any other solution than to ca= ll the shell like this:
bash <file>

With <= file> containing the commands. With that type of call, bash keeps readin= g STDIN for user inputs. That's why I've introduced the process sub= stitution solution


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

> Go into a tramp buffer, then execute:
> (async-shell-command "echo -n \"Type something:\"; read= line; echo
> line=3D$line" nil nil)
>
> Your command will print:
>
> Type something:line=3D
>
> and terminate.

Well, the problem is that the heredoc construct occupies STDIN, which= is
not available for the shell command then. I will check what I can do.

Best regards, Michael.

--001a1134541a9a327004f1a9cbc2-- From debbugs-submit-bounces@debbugs.gnu.org Wed Feb 05 10:33:41 2014 Received: (at 16582) by debbugs.gnu.org; 5 Feb 2014 15:33:41 +0000 Received: from localhost ([127.0.0.1]:51048 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WB4Ts-0008S3-TE for submit@debbugs.gnu.org; Wed, 05 Feb 2014 10:33:41 -0500 Received: from mout.gmx.net ([212.227.15.15]:54466) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WB4Tp-0008Rr-Fk for 16582@debbugs.gnu.org; Wed, 05 Feb 2014 10:33:38 -0500 Received: from detlef.gmx.de ([93.209.68.221]) by mail.gmx.com (mrgmx002) with ESMTPS (Nemesis) id 0MRo6b-1Vn6U23UbJ-00T0dA for <16582@debbugs.gnu.org>; Wed, 05 Feb 2014 16:33:36 +0100 From: Michael Albinus To: Sylvain Chouleur Subject: Re: bug#16582: Bug: tramp shell command doesn't read stdin References: <87k3di97pa.fsf@gmx.de> <87eh3k5pdb.fsf@gmx.de> <87zjm6rmi1.fsf@gmx.de> <87r47hsvld.fsf@gmx.de> <87lhxpslji.fsf@gmx.de> Date: Wed, 05 Feb 2014 16:33:32 +0100 In-Reply-To: (Sylvain Chouleur's message of "Wed, 5 Feb 2014 15:44:14 +0100") Message-ID: <87r47htvzn.fsf@gmx.de> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K0:mRImsCRt4OTPswsqmWXOnK0Chl6hn2UjGoA23a96Npdz4Wv5Kjc aYSUfWwyzmv+0qxjcHs+gxcJH/Nr1U9pCCUrgnylMM/yP6RKtBKHxlhxJb8RcBZDpcmiFUG 3VJ4f4sxzSWBbPnZ9KvVFtdAMoU6JU/EVpAY+W0zP8curoGbcb6154U65IaFj9NIDbFjC21 mgm3zMtsOvES0u5WPpohA== X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 16582 Cc: 16582@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) Sylvain Chouleur writes: > Yes, that is the problem I'm trying to explain since the beginning, I'm > please we have finally agreed on what was the issue :) What about this one (the new tramp-end-heredoc patch is already in): --8<---------------cut here---------------start------------->8--- *** /home/albinmic/src/tramp/lisp/tramp-sh.el.~master~ 2014-02-05 16:27:23.314546196 +0100 --- /home/albinmic/src/tramp/lisp/tramp-sh.el 2014-02-05 16:24:58.391993324 +0100 *************** *** 2720,2726 **** (file-remote-p default-directory) tramp-initial-end-of-output)) (if heredoc ! (format "%s\n%s\n%s" program (car args) tramp-end-of-heredoc) (mapconcat 'tramp-shell-quote-argument (cons program args) " "))))) --- 2720,2726 ---- (file-remote-p default-directory) tramp-initial-end-of-output)) (if heredoc ! (format "%s\n(\n%s\n) 8--- Best regards, Michael. From debbugs-submit-bounces@debbugs.gnu.org Wed Feb 05 16:02:26 2014 Received: (at 16582) by debbugs.gnu.org; 5 Feb 2014 21:02:26 +0000 Received: from localhost ([127.0.0.1]:51275 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WB9c2-0008U1-8X for submit@debbugs.gnu.org; Wed, 05 Feb 2014 16:02:26 -0500 Received: from mail-qa0-f45.google.com ([209.85.216.45]:64477) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WB9bz-0008Tr-3S for 16582@debbugs.gnu.org; Wed, 05 Feb 2014 16:02:23 -0500 Received: by mail-qa0-f45.google.com with SMTP id ii20so1437658qab.32 for <16582@debbugs.gnu.org>; Wed, 05 Feb 2014 13:02:22 -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=Ta78DHNE8vWetulPWo5h1jU/5oB98p7PWxDETl75/e4=; b=K0EE41IEF8QhKkVHNXWxmvB+So7+ACP9Yri4atKKTsp9TQeupqaD/zVjbIZUwFFxwj +oFhPlB9iBMAf1d9SrSPjbUtxtyzL1msOH7GzwSAlTuDoSGZfQCccdAO66dy9Xgo45eX 2Ke9rrCWK+VgASeMoGmXdGg471S6aPh+0+tPeV1E6DKe8q//JPeIFr2qaChdR4y1i0VI AMXcgCrOEqvpLd78qx127tsOFn5oAH88a2Lx2bak/ebttee1IXsduuTu+WZ23UIO+KJR BMog1A+mhVGKlmihlhKbMO+Pnc4AMMPWLvWIAOQIz1vriDW7mQ0YHUsNzN+jNsjxFRNh L6wg== X-Received: by 10.224.97.7 with SMTP id j7mr6363664qan.81.1391634138764; Wed, 05 Feb 2014 13:02:18 -0800 (PST) MIME-Version: 1.0 Received: by 10.96.63.134 with HTTP; Wed, 5 Feb 2014 13:01:58 -0800 (PST) In-Reply-To: <87r47htvzn.fsf@gmx.de> References: <87k3di97pa.fsf@gmx.de> <87eh3k5pdb.fsf@gmx.de> <87zjm6rmi1.fsf@gmx.de> <87r47hsvld.fsf@gmx.de> <87lhxpslji.fsf@gmx.de> <87r47htvzn.fsf@gmx.de> From: Sylvain Chouleur Date: Wed, 5 Feb 2014 22:01:58 +0100 Message-ID: Subject: Re: bug#16582: Bug: tramp shell command doesn't read stdin To: Michael Albinus Content-Type: multipart/alternative; boundary=001a11c3ec7e7f99fd04f1af12ca X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 16582 Cc: 16582@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) --001a11c3ec7e7f99fd04f1af12ca Content-Type: text/plain; charset=ISO-8859-1 that's great! I didn't think about this one, it works very well. Thank you a lot -- Sylvain 2014-02-05 Michael Albinus : > Sylvain Chouleur writes: > > > Yes, that is the problem I'm trying to explain since the beginning, I'm > > please we have finally agreed on what was the issue :) > > What about this one (the new tramp-end-heredoc patch is already in): > > --8<---------------cut here---------------start------------->8--- > *** /home/albinmic/src/tramp/lisp/tramp-sh.el.~master~ 2014-02-05 > 16:27:23.314546196 +0100 > --- /home/albinmic/src/tramp/lisp/tramp-sh.el 2014-02-05 > 16:24:58.391993324 +0100 > *************** > *** 2720,2726 **** > (file-remote-p default-directory) > tramp-initial-end-of-output)) > (if heredoc > ! (format "%s\n%s\n%s" > program (car args) tramp-end-of-heredoc) > (mapconcat 'tramp-shell-quote-argument > (cons program args) " "))))) > --- 2720,2726 ---- > (file-remote-p default-directory) > tramp-initial-end-of-output)) > (if heredoc > ! (format "%s\n(\n%s\n) program (car args) tramp-end-of-heredoc) > (mapconcat 'tramp-shell-quote-argument > (cons program args) " "))))) > --8<---------------cut here---------------end--------------->8--- > > Best regards, Michael. > --001a11c3ec7e7f99fd04f1af12ca Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
that's great! I didn't think about this one, it wo= rks very well.

Thank you a lot

= --=A0
Sylvain


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

> Yes, that is the problem I'm trying to explain since the beginning= , I'm
> please we have finally agreed on what was the issue :)

What about this one (the new tramp-end-heredoc patch is already in):<= br>
--8<---------------cut here---------------start------------->8---
*** /home/albinmic/src/tramp/lisp/tramp-sh.el.~master~ =A02014-02-05 16:27:= 23.314546196 +0100
--- /home/albinmic/src/tramp/lisp/tramp-sh.el =A0 2014-02-05 16:24:58.39199= 3324 +0100
***************
*** 2720,2726 ****
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0(file-remote= -p default-directory)
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0tramp-initia= l-end-of-output))
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 (if heredoc
! =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 (format "%s\n%s\n%s&= quot;
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 program= (car args) tramp-end-of-heredoc)
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 (mapconcat 'tramp-shell= -quote-argument
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0(con= s program args) " ")))))
--- 2720,2726 ----
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0(file-remote= -p default-directory)
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0tramp-initia= l-end-of-output))
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 (if heredoc
! =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 (format "%s\n(\n%s\n= ) </dev/tty\n%s"
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 program= (car args) tramp-end-of-heredoc)
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 (mapconcat 'tramp-shell= -quote-argument
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0(con= s program args) " ")))))
--8<---------------cut here---------------end--------------->8---

Best regards, Michael.

--001a11c3ec7e7f99fd04f1af12ca-- From debbugs-submit-bounces@debbugs.gnu.org Thu Feb 06 03:52:32 2014 Received: (at 16582-done) by debbugs.gnu.org; 6 Feb 2014 08:52:32 +0000 Received: from localhost ([127.0.0.1]:52062 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WBKhD-0001Pv-Pp for submit@debbugs.gnu.org; Thu, 06 Feb 2014 03:52:31 -0500 Received: from mout.gmx.net ([212.227.15.19]:56622) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WBKhB-0001Pm-O8 for 16582-done@debbugs.gnu.org; Thu, 06 Feb 2014 03:52:30 -0500 Received: from detlef.gmx.de ([93.209.70.75]) by mail.gmx.com (mrgmx003) with ESMTPS (Nemesis) id 0M3j17-1VKKT444eX-00rJv4 for <16582-done@debbugs.gnu.org>; Thu, 06 Feb 2014 09:52:28 +0100 From: Michael Albinus To: Sylvain Chouleur Subject: Re: bug#16582: Bug: tramp shell command doesn't read stdin References: <87k3di97pa.fsf@gmx.de> <87eh3k5pdb.fsf@gmx.de> <87zjm6rmi1.fsf@gmx.de> <87r47hsvld.fsf@gmx.de> <87lhxpslji.fsf@gmx.de> <87r47htvzn.fsf@gmx.de> Date: Thu, 06 Feb 2014 09:52:24 +0100 In-Reply-To: (Sylvain Chouleur's message of "Wed, 5 Feb 2014 22:01:58 +0100") Message-ID: <87iossei7r.fsf@gmx.de> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K0:HWrlXNbjCQuGipTMXArhRYwDLXyTGDqbyWpn68y0fnineVkhDo6 kWrIGCwFeXYJoIMvOn3KMplvRC1aE0iUTOCFowDfUTsrHYv99aSFWRXk5J+Cur9VcAUtg9K hZHyyRsz7zzhLcnN2B88MRFAi6GlCuly/cN9Z1bcPmNUJyamAe3HP4BdXspSsIFuvX20fNT Ia22RfVh3pMaivIJpca0w== X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 16582-done Cc: 16582-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) Sylvain Chouleur writes: > that's great! I didn't think about this one, it works very well. I've committed the patch, closing the bug. Best regards, Michael. From unknown Sun Jun 22 11:36:53 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Thu, 06 Mar 2014 12:24:07 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator