From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Kevin Rodgers Newsgroups: gmane.emacs.help Subject: Re: operating on dired marked files Date: Thu, 26 Jan 2006 17:09:07 -0700 Message-ID: References: <1138318584.044596.292590@f14g2000cwb.googlegroups.com> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1138320735 5095 80.91.229.2 (27 Jan 2006 00:12:15 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 27 Jan 2006 00:12:15 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Jan 27 01:12:15 2006 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1F2HDq-0006JF-BX for geh-help-gnu-emacs@m.gmane.org; Fri, 27 Jan 2006 01:12:14 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1F2HGe-0007bj-Fr for geh-help-gnu-emacs@m.gmane.org; Thu, 26 Jan 2006 19:15:08 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1F2HE2-0006Ul-HO for help-gnu-emacs@gnu.org; Thu, 26 Jan 2006 19:12:26 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1F2HDz-0006UE-BQ for help-gnu-emacs@gnu.org; Thu, 26 Jan 2006 19:12:24 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1F2HDy-0006U8-V6 for help-gnu-emacs@gnu.org; Thu, 26 Jan 2006 19:12:23 -0500 Original-Received: from [80.91.229.2] (helo=ciao.gmane.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA:32) (Exim 4.52) id 1F2HBc-00056y-UL for help-gnu-emacs@gnu.org; Thu, 26 Jan 2006 19:09:57 -0500 Original-Received: from list by ciao.gmane.org with local (Exim 4.43) id 1F2HAz-0005j7-Bo for help-gnu-emacs@gnu.org; Fri, 27 Jan 2006 01:09:18 +0100 Original-Received: from 207.167.42.60 ([207.167.42.60]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 27 Jan 2006 01:09:17 +0100 Original-Received: from ihs_4664 by 207.167.42.60 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 27 Jan 2006 01:09:17 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-To: help-gnu-emacs@gnu.org Original-Lines: 49 Original-X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: 207.167.42.60 User-Agent: Mozilla Thunderbird 0.9 (X11/20041105) X-Accept-Language: en-us, en In-Reply-To: <1138318584.044596.292590@f14g2000cwb.googlegroups.com> X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:32863 Archived-At: 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