help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: dired copy marked files in xterm


From: Fabian Braennstroem
Subject: Re: dired copy marked files in xterm
Date: Mon, 3 Mar 2008 20:44:24 +0100
User-agent: slrn/0.9.8.1pl1 (Debian)

Hi Piet,

* Piet van Oostrum <piet@cs.uu.nl> wrote:
>>>>>> Fabian Braennstroem <f.braennstroem@gmx.de> (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


reply via email to

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