* operating on dired marked files
@ 2006-01-26 23:36 largo-linux
2006-01-27 0:09 ` Kevin Rodgers
2006-01-27 0:09 ` François Gannaz
0 siblings, 2 replies; 3+ messages in thread
From: largo-linux @ 2006-01-26 23:36 UTC (permalink / raw)
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
???
thanks.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: operating on dired marked files
2006-01-26 23:36 operating on dired marked files largo-linux
@ 2006-01-27 0:09 ` Kevin Rodgers
2006-01-27 0:09 ` François Gannaz
1 sibling, 0 replies; 3+ messages in thread
From: Kevin Rodgers @ 2006-01-27 0:09 UTC (permalink / raw)
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
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: operating on dired marked files
2006-01-26 23:36 operating on dired marked files largo-linux
2006-01-27 0:09 ` Kevin Rodgers
@ 2006-01-27 0:09 ` François Gannaz
1 sibling, 0 replies; 3+ messages in thread
From: François Gannaz @ 2006-01-27 0:09 UTC (permalink / raw)
Le jeu 26 jan 15:36, largo-linux a écrit :
> 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
>
You should read the documentation, it is faster than asking here.
Typing C-h k ! gives :
** <quote> **
! 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.
[...]
** </quote> **
The last paragraph is exactly what you want.
--
François Gannaz
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2006-01-27 0:09 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-01-26 23:36 operating on dired marked files largo-linux
2006-01-27 0:09 ` Kevin Rodgers
2006-01-27 0:09 ` François Gannaz
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.