From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Michael Albinus Newsgroups: gmane.emacs.bugs Subject: bug#16582: Bug: tramp shell command doesn't read stdin Date: Mon, 03 Feb 2014 13:53:36 +0100 Message-ID: <87eh3k5pdb.fsf@gmx.de> References: <87k3di97pa.fsf@gmx.de> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: ger.gmane.org 1391432056 5454 80.91.229.3 (3 Feb 2014 12:54:16 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 3 Feb 2014 12:54:16 +0000 (UTC) Cc: 16582@debbugs.gnu.org To: Sylvain Chouleur Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Feb 03 13:54:23 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 1WAJ2c-0001tk-1m for geb-bug-gnu-emacs@m.gmane.org; Mon, 03 Feb 2014 13:54:22 +0100 Original-Received: from localhost ([::1]:45906 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WAJ2b-00021M-KW for geb-bug-gnu-emacs@m.gmane.org; Mon, 03 Feb 2014 07:54:21 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:48782) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WAJ2R-000214-3X for bug-gnu-emacs@gnu.org; Mon, 03 Feb 2014 07:54:18 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WAJ2J-0006nC-G8 for bug-gnu-emacs@gnu.org; Mon, 03 Feb 2014 07:54:11 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:33429) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WAJ2J-0006n4-D6 for bug-gnu-emacs@gnu.org; Mon, 03 Feb 2014 07:54:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1WAJ2I-0000tn-2N for bug-gnu-emacs@gnu.org; Mon, 03 Feb 2014 07:54:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Michael Albinus Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 03 Feb 2014 12: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.13914320253428 (code B ref 16582); Mon, 03 Feb 2014 12:54:01 +0000 Original-Received: (at 16582) by debbugs.gnu.org; 3 Feb 2014 12:53:45 +0000 Original-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 Original-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 Original-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 In-Reply-To: (Sylvain Chouleur's message of "Sun, 2 Feb 2014 15:27:35 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) X-Provags-ID: V03:K0:+2xXt6Y4PF4yoQr3e7ILbK91ypgbWA3vi3OmrYSfw/f0KPJjeq1 Q7UXwxdujZ7WZrxNL6+qfnxy0P6TEfr6cW6qEWDWP4uYAA+NWu5eOZCOVO2LBVlhKnXedUT 3cMGDxYNQTb2oCVfHvH3kLIWK72rGifDvkJJohNtT7KZLSkOvZbWk+WzpSlZMmZfQbZmQpk gIIftRaDiA4nV7HP7xPcA== 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:84507 Archived-At: --=-=-= 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 "<