From: Piet van Oostrum <piet@cs.uu.nl>
To: help-gnu-emacs@gnu.org
Subject: Re: dired copy marked files in xterm
Date: Wed, 27 Feb 2008 11:49:36 +0100 [thread overview]
Message-ID: <m2oda2hdxb.fsf@cs.uu.nl> (raw)
In-Reply-To: fq1sc8$7b1$1@tamarack.fernuni-hagen.de
>>>>> 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)
--
Piet van Oostrum <piet@cs.uu.nl>
URL: http://pietvanoostrum.com [PGP 8DAE142BE17999C4]
Private email: piet@vanoostrum.org
next prev parent reply other threads:[~2008-02-27 10:49 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-02-24 19:26 dired copy marked files in xterm Fabian Braennstroem
2008-02-24 21:05 ` Thierry Volpiatto
2008-02-24 21:11 ` David Hansen
[not found] ` <mailman.7870.1203888211.18990.help-gnu-emacs@gnu.org>
2008-02-25 19:10 ` Fabian Braennstroem
[not found] ` <mailman.7867.1203886432.18990.help-gnu-emacs@gnu.org>
2008-02-25 19:15 ` Fabian Braennstroem
2008-02-26 10:22 ` Piet van Oostrum
2008-02-26 20:21 ` Fabian Braennstroem
2008-02-27 10:49 ` Piet van Oostrum [this message]
2008-03-03 19:44 ` Fabian Braennstroem
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=m2oda2hdxb.fsf@cs.uu.nl \
--to=piet@cs.uu.nl \
--cc=help-gnu-emacs@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.