From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Fabian Braennstroem Newsgroups: gmane.emacs.help Subject: Re: dired copy marked files in xterm Date: Mon, 3 Mar 2008 20:44:24 +0100 Organization: www.braennstroem.de Message-ID: References: Reply-To: f.braennstroem@gmx.de NNTP-Posting-Host: lo.gmane.org X-Trace: ger.gmane.org 1204576937 2877 80.91.229.12 (3 Mar 2008 20:42:17 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 3 Mar 2008 20:42:17 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Mar 03 21:42:43 2008 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1JWHUY-0006JK-Ij for geh-help-gnu-emacs@m.gmane.org; Mon, 03 Mar 2008 21:42:34 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JWHU1-0005BD-LB for geh-help-gnu-emacs@m.gmane.org; Mon, 03 Mar 2008 15:42:01 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!postnews.google.com!news3.google.com!proxad.net!feeder1-2.proxad.net!feeder.erje.net!news-fra1.dfn.de!news-koe1.dfn.de!tamarack.fernuni-hagen.de!news.fernuni-hagen.de!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 49 Original-NNTP-Posting-Host: stgt-4dbdb6e6.pool.einsundeins.de Original-X-Trace: tamarack.fernuni-hagen.de 1204573461 15836 77.189.182.230 (3 Mar 2008 19:44:21 GMT) Original-X-Complaints-To: newsadmin@fernuni-hagen.de Original-NNTP-Posting-Date: Mon, 3 Mar 2008 19:44:21 +0000 (UTC) User-Agent: slrn/0.9.8.1pl1 (Debian) Original-Xref: shelby.stanford.edu gnu.emacs.help:156655 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:52027 Archived-At: Hi Piet, * Piet van Oostrum wrote: >>>>>> Fabian Braennstroem (FB) wrote: > >>FB> Thanks for your help! This works good with a small adjustment. >>FB> A different problem is to use 'scp' or in my case something similar, in my case 'hput'. It copies the file to the cluster with a syntax like: > >>FB> hput -R cluster_directory files_to_copy > >>FB> Using: 'hput -R /some_remote_directory *' as a shell-command works, but a small adjustment of your line: > >>FB> (defun hputbackground() >>FB> "Put" >>FB> (interactive) >>FB> (message (dired-dwim-target-directory)) >>FB> (message (replace-regexp-in-string "/rsh:ppb37@10.134.130.2:" "" (dired-dwim-target-directory))) >>FB> (call-process-shell-command (concat (dired-shell-stuff-it "xterm -e 'hput -R " (replace-regexp-in-string "/rsh:ppb37@10.134.130.2:" "" (dired-dwim-target-directory)) nil) " " (dired-get-marked-files) " '&")) >>FB> ;(call-process-shell-command (concat (dired-shell-stuff-it "xterm -e 'cp -R " (dired-get-marked-files) nil) " " (dired-dwim-target-directory) " '&")) >>FB> ) > >>FB> gives me this error: > >>FB> /rsh:ppb37@10.134.130.2:/home/ppb37/ >>FB> /home/ppb37/ >>FB> shell-quote-argument: Wrong type argument: stringp, 47 > >>FB> Do you have an idea!? > > Yes, (dired-get-marked-files) should be used as the second argument of > dired-shell-stuff-it. > > So I guess you should use something like: > > (concat (dired-shell-stuff-it (concat "xterm -e 'hput -R " > (replace-regexp-in-string "/rsh:ppb37@10.134.130.2:" "" > (dired-dwim-target-directory))) (dired-get-marked-files) nil) " '&") > > (defun dired-shell-stuff-it (command file-list on-each &optional raw-arg) > ;; "Make up a shell command line from COMMAND and FILE-LIST. > ;; If ON-EACH is t, COMMAND should be applied to each file, else > ;; simply concat all files and apply COMMAND to this. > ;; FILE-LIST's elements will be quoted for the shell." > (raw-arg isn't used) Thanks for your help! It works... :-) Greetings! Fabian