From: Jeff Woods Subject: Re: renaming multiple files Date: Tue, 07 Dec 2004 18:05:47 -0700 Message-ID: <6.1.2.0.0.20041207175728.02fbe190@mail.spamcop.net> References: <41A20C74.4050709@fcaglp.unlp.edu.ar> <16802.37568.605213.224819@cerise.gclements.plus.com> Mime-Version: 1.0 Return-path: In-Reply-To: <16802.37568.605213.224819@cerise.gclements.plus.com> References: <41A20C74.4050709@fcaglp.unlp.edu.ar> <16802.37568.605213.224819@cerise.gclements.plus.com> Sender: linux-admin-owner@vger.kernel.org List-Id: Content-Type: text/plain; charset="us-ascii"; format="flowed" Content-Transfer-Encoding: 7bit To: Glynn Clements Cc: zyserman@fcaglp.unlp.edu.ar, linux-admin@vger.kernel.org At 11/23/2004 01:30 AM +0000, Glynn Clements wrote: > for file in prefix-* ; do > mv "$file" "${file##prefix-}" > done Almost correct. What happens if one of the files is named "prefix-prefix-1"? What about "prefix-"? I suggest: for file in prefix-?* do mv "$file" "${file#prefix-}" done -- Jeff Woods "Errors creep into everything, and the only way to expunge them is to have any bit of work reviewed by a few others." -- Wirt Atmar, 10-27-2001 "The great thing about Open Source software is that you can have any color screen of death that you want." -- Gavin Scott, 08-22-2000