From: Glynn Clements Subject: Re: renaming multiple files Date: Thu, 9 Dec 2004 19:09:26 +0000 Message-ID: <16824.41702.114498.362890@cerise.gclements.plus.com> References: <41A20C74.4050709@fcaglp.unlp.edu.ar> <16802.37568.605213.224819@cerise.gclements.plus.com> <6.1.2.0.0.20041207175728.02fbe190@mail.spamcop.net> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <6.1.2.0.0.20041207175728.02fbe190@mail.spamcop.net> Sender: linux-admin-owner@vger.kernel.org List-Id: Content-Type: text/plain; charset="us-ascii" To: Jeff Woods Cc: zyserman@fcaglp.unlp.edu.ar, linux-admin@vger.kernel.org Jeff Woods 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"? It gets renamed to prefix-1, which is what I would expect. > What about "prefix-"? > > I suggest: > > for file in prefix-?* > do > mv "$file" "${file#prefix-}" > done Huh? -- Glynn Clements