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: Tue, 26 Feb 2008 21:21:33 +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 1204058461 10992 80.91.229.12 (26 Feb 2008 20:41:01 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 26 Feb 2008 20:41:01 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Feb 26 21:41:24 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 1JU6bs-00026n-KR for geh-help-gnu-emacs@m.gmane.org; Tue, 26 Feb 2008 21:41:08 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JU6bM-00073H-Mb for geh-help-gnu-emacs@m.gmane.org; Tue, 26 Feb 2008 15:40:36 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!news.tele.dk!news.tele.dk!small.news.tele.dk!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: 57 Original-NNTP-Posting-Host: stgt-4dbdc479.pool.einsundeins.de Original-X-Trace: tamarack.fernuni-hagen.de 1204057288 7521 77.189.196.121 (26 Feb 2008 20:21:28 GMT) Original-X-Complaints-To: newsadmin@fernuni-hagen.de Original-NNTP-Posting-Date: Tue, 26 Feb 2008 20:21:28 +0000 (UTC) User-Agent: slrn/0.9.8.1pl1 (Debian) Original-Xref: shelby.stanford.edu gnu.emacs.help:156527 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:51894 Archived-At: Hi Piet, * Piet van Oostrum wrote: >>>>>> Fabian Braennstroem (FB) wrote: > >>FB> Hi, > >>FB> I would like to use the system 'cp' function in an xterm >>FB> to copy marked files in dired. >>FB> Right now, this small function works with the current >>FB> file: > >>FB> (defun tacopybackground(var1) >>FB> "Copy" >>FB> (interactive) >>FB> (call-process-shell-command (concat "xterm -e 'cp -R "(dired-get-filename)" " (dired-dwim-target-directory) " &'")) >>FB> ) > >>FB> but obviously it needs some kind of loop or different >>FB> approach for marked files!?: > >>FB> (call-process-shell-command (concat "xterm -e 'cp -R "(dired-get-marked-files)" " (dired-dwim-target-directory) " &'")) > > Does this what you want? > > (call-process-shell-command (concat (dired-shell-stuff-it "xterm -e 'cp -R " (dired-get-marked-files) nil) " " (dired-dwim-target-directory) " &'")) > > By the way, you may have to do some additional shell-quoting on the target > directory. dired-shell-stuff-t does it on the file list. Thanks for your help! This works good with a small adjustment. 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: hput -R cluster_directory files_to_copy Using: 'hput -R /some_remote_directory *' as a shell-command works, but a small adjustment of your line: (defun hputbackground() "Put" (interactive) (message (dired-dwim-target-directory)) (message (replace-regexp-in-string "/rsh:ppb37@10.134.130.2:" "" (dired-dwim-target-directory))) (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) " '&")) ;(call-process-shell-command (concat (dired-shell-stuff-it "xterm -e 'cp -R " (dired-get-marked-files) nil) " " (dired-dwim-target-directory) " '&")) ) gives me this error: /rsh:ppb37@10.134.130.2:/home/ppb37/ /home/ppb37/ shell-quote-argument: Wrong type argument: stringp, 47 Do you have an idea!? Greetings! Fabian