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

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

Re: operating on dired marked files


From: Kevin Rodgers
Subject: Re: operating on dired marked files
Date: Thu, 26 Jan 2006 17:09:07 -0700
User-agent: Mozilla Thunderbird 0.9 (X11/20041105)

largo-linux wrote:
I would like to mark a number of files in dired and then use those
files as arguments to a command.

but when i try this in dired, i.e. i mark three files then hit ! and
then perhaps a perl script.  it seems only to output the results of the
third file.  is there a way to do this so that it executes

script.pl file1.txt file2.txt file3.txt

Actually, it executes:

script.pl file1.txt; script.pl file2.txt; script.pl file3.txt

As explained below, `! script.pl *' does what you want:

,----[ C-h k ! ]
| ! runs the command dired-do-shell-command
|    which is an interactive compiled Lisp function in `dired-aux'.
| (dired-do-shell-command COMMAND &optional ARG FILE-LIST)
|
| Run a shell command COMMAND on the marked files.
| If no files are marked or a specific numeric prefix arg is given,
| the next ARG files are used.  Just C-u means the current file.
| The prompt mentions the file(s) or the marker, as appropriate.
|
| If there is output, it goes to a separate buffer.
|
| Normally the command is run on each file individually.
| However, if there is a `*' in the command then it is run
| just once with the entire file list substituted there.
|
| If there is no `*', but a `?' in the command then it is still run
| on each file individually but with the filename substituted there
| instead of at the end of the command.
|
| No automatic redisplay of dired buffers is attempted, as there's no
| telling what files the command may have changed.  Type
| l to redisplay the marked files.
|
| The shell command has the top level directory as working directory, so
| output files usually are created there instead of in a subdir.
|
| In a noninteractive call (from Lisp code), you must specify
| the list of file names explicitly with the FILE-LIST argument.
`----

--
Kevin Rodgers





reply via email to

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