[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: dired copy marked files in xterm

From: Piet van Oostrum
Subject: Re: dired copy marked files in xterm
Date: Wed, 27 Feb 2008 11:49:36 +0100
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1.90 (darwin)

>>>>> Fabian Braennstroem <address@hidden> (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:address@hidden:" "" 
>FB>        (call-process-shell-command (concat (dired-shell-stuff-it "xterm -e 
>'hput -R " (replace-regexp-in-string "/rsh:address@hidden:" "" 
>(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:address@hidden:/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

So I guess you should use something like:

(concat (dired-shell-stuff-it (concat "xterm -e 'hput -R "
(replace-regexp-in-string "/rsh:address@hidden:" ""
(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)
Piet van Oostrum <address@hidden>
URL: [PGP 8DAE142BE17999C4]
Private email: address@hidden

reply via email to

[Prev in Thread] Current Thread [Next in Thread]