From: Fabian Braennstroem <f.braennstroem@gmx.de>
To: help-gnu-emacs@gnu.org
Subject: Re: dired copy marked files in xterm
Date: Tue, 26 Feb 2008 21:21:33 +0100 [thread overview]
Message-ID: <fq1sc8$7b1$1@tamarack.fernuni-hagen.de> (raw)
In-Reply-To: m2tzjwggpq.fsf@cs.uu.nl
Hi Piet,
* Piet van Oostrum <piet@cs.uu.nl> wrote:
>>>>>> Fabian Braennstroem <f.braennstroem@gmx.de> (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
next prev parent reply other threads:[~2008-02-26 20:21 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 [this message]
2008-02-27 10:49 ` Piet van Oostrum
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
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='fq1sc8$7b1$1@tamarack.fernuni-hagen.de' \
--to=f.braennstroem@gmx.de \
--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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).