From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Peter Dyballa Newsgroups: gmane.emacs.help Subject: Re: recursively move types of files Date: Thu, 15 May 2008 14:06:09 +0200 Message-ID: <8717151A-EF92-492D-A672-2FDAD02853DF@Web.DE> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 (Apple Message framework v753) Content-Type: text/plain; charset=WINDOWS-1252; delsp=yes; format=flowed Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1210853226 18176 80.91.229.12 (15 May 2008 12:07:06 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 15 May 2008 12:07:06 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: Charles L. Snyder Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu May 15 14:07:41 2008 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1JwcEv-0001tR-M8 for geh-help-gnu-emacs@m.gmane.org; Thu, 15 May 2008 14:07:17 +0200 Original-Received: from localhost ([127.0.0.1]:52261 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JwcEC-0007xb-HO for geh-help-gnu-emacs@m.gmane.org; Thu, 15 May 2008 08:06:32 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JwcDw-0007wT-6U for help-gnu-emacs@gnu.org; Thu, 15 May 2008 08:06:16 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JwcDt-0007v3-TE for help-gnu-emacs@gnu.org; Thu, 15 May 2008 08:06:15 -0400 Original-Received: from [199.232.76.173] (port=49491 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JwcDt-0007uw-N2 for help-gnu-emacs@gnu.org; Thu, 15 May 2008 08:06:13 -0400 Original-Received: from fmmailgate01.web.de ([217.72.192.221]:49874) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1JwcDs-0006Bj-4x for help-gnu-emacs@gnu.org; Thu, 15 May 2008 08:06:12 -0400 Original-Received: from smtp05.web.de (fmsmtp05.dlan.cinetic.de [172.20.4.166]) by fmmailgate01.web.de (Postfix) with ESMTP id 256A8DF1D3F3; Thu, 15 May 2008 14:06:11 +0200 (CEST) Original-Received: from [195.4.205.125] (helo=[192.168.1.2]) by smtp05.web.de with asmtp (TLSv1:AES128-SHA:128) (WEB.DE 4.109 #226) id 1JwcDq-0003Ip-00; Thu, 15 May 2008 14:06:11 +0200 In-Reply-To: X-Mailer: Apple Mail (2.753) X-Sender: Peter_Dyballa@web.de X-Provags-ID: V01U2FsdGVkX19CpTM5xaEJsnZZMfFq6bIjLvU4O36Dr2kK31o6 CnDNVM1o9GaJyf4chK43RNOgPcSCSVeUW1ThUUAUki5cV9UFs3 UEwlq7b8r/HwYXYNn9Mw== X-detected-kernel: by monty-python.gnu.org: Linux 2.4-2.6 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:54010 Archived-At: Am 15.05.2008 um 02:22 schrieb Charles L. Snyder: > 2. I have a huge number of files named like this > "Report_work_01232008_blah.pdf", and I want to replace all the "_" > with " " It's probably better to do it outside dired-mode, in a *shell* buffer: find -type f -exec trans.sh {} \; maybe added with a -name option and a shell script trans.sh =20= like: #!/bin/sh dir=3D"`dirname $1`" fil=3D"`basename $1`" new=3D"`echo "$fil" | tr _ ' '`" mv "$1" "$dir/$new" or in bash: #!/bin/bash dir=3D$(dirname $1) fil=3D$(basename $1) new=3D$(echo "$fil" | tr _ ' ') mv "$1" "$dir/$new" -- Greetings Pete When in doubt, use brute force. =96 Ken Thompson