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: Tue, 4 Feb 2014 23:53:26 +0100 Message-ID: References: <87k3di97pa.fsf@gmx.de> <87eh3k5pdb.fsf@gmx.de> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a11c291e648dad304f19c8323 X-Trace: ger.gmane.org 1391554450 25029 80.91.229.3 (4 Feb 2014 22:54:10 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 4 Feb 2014 22:54:10 +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 Tue Feb 04 23:54:16 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 1WAosh-0001f0-OM for geb-bug-gnu-emacs@m.gmane.org; Tue, 04 Feb 2014 23:54:15 +0100 Original-Received: from localhost ([::1]:55977 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WAosh-0008FL-6p for geb-bug-gnu-emacs@m.gmane.org; Tue, 04 Feb 2014 17:54:15 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:32950) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WAosa-0008E4-4i for bug-gnu-emacs@gnu.org; Tue, 04 Feb 2014 17:54:12 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WAosU-000568-DJ for bug-gnu-emacs@gnu.org; Tue, 04 Feb 2014 17:54:08 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:35821) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WAosU-000563-9Y for bug-gnu-emacs@gnu.org; Tue, 04 Feb 2014 17:54:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1WAosT-0002eU-S6 for bug-gnu-emacs@gnu.org; Tue, 04 Feb 2014 17:54:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Sylvain Chouleur Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 04 Feb 2014 22:54:01 +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.139155443010177 (code B ref 16582); Tue, 04 Feb 2014 22:54:01 +0000 Original-Received: (at 16582) by debbugs.gnu.org; 4 Feb 2014 22:53:50 +0000 Original-Received: from localhost ([127.0.0.1]:49840 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WAosH-0002e4-Uj for submit@debbugs.gnu.org; Tue, 04 Feb 2014 17:53:50 -0500 Original-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 Original-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) Original-Received: by 10.96.63.134 with HTTP; Tue, 4 Feb 2014 14:53:26 -0800 (PST) In-Reply-To: <87eh3k5pdb.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:84570 Archived-At: --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--