delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2005/05/20/11:41:46

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
To: cygwin AT cygwin DOT com
From: Andrew Schulman <andrex AT alumni DOT utexas DOT net>
Subject: Re: Command to move groups of files
Date: Fri, 20 May 2005 11:35:33 -0400
Lines: 20
Message-ID: <5tpjnp1bezoj$.1oqpyep8fo0mg$.dlg@40tude.net>
References: <428DE516 DOT 8020901 AT buddydog DOT org>
Mime-Version: 1.0
User-Agent: 40tude_Dialog/2.0.15.1 (af46100d.188.279)
X-Archive: Yes
X-IsSubscribed: yes

> Somone a month or so ago posted a list of little known Cygwin
> commands, and in that list was a cool command that allowed you
> to rename a list of files, like thus:
> 
>   cmd First*.* Second*.*
> 
> which would rename all files starting with "First" to be "Second".
> I used this command a bit, and then promptly forgot about it until
> I really needed to use it yesterday.
> 
> Could someone remind me of the name of that command?

Yes, I remember the command.  Its name is:

for ff in First*.* ; do
  mv $ff Second${ff#First}
done

Works for me, I use it all the time :)


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019