This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Command to move groups of files


> 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/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]