/*--------------------------------------------------------------------------*\ * PROGRAM: mvp - move with pattern, version 1.01 * * PURPOSE: Rename a set of files according to a given pattern. * * BLURB: Are you tired of running into a situation where you have a * bunch of files that you want to rename in the same way, but * you have no tool to do that for you? For instance, you might * have a bunch of files 'data01.dat' to 'data99.dat' and you * want to rename them to use four digits for the numbers. Well, * now you can. This program will allow you to make simple * changes to groups of filenames by allowing you to insert a * common substring or cut one from a certain point in all of the * filenames given. * * WEB PAGE: http://www.pobox.com/~csbruce/unix/ * * HISTORY: * DATE PROGRAMMER DESCRIPTION * 03-Oct-1996 Craig Bruce Initial creation * 20-Dec-1997 Craig Bruce Spruced up for Internet rollout \*--------------------------------------------------------------------------*/ mvp version 1.01 by Craig Bruce, 20-Dec-1997 usage: mvp [-v] filename ... 'renamePattern' ranamePattern: "txt" = match txt, "*" = wildcard - copy to end, "*.ext" = copy up to ext, "?" = match any char, "+instxt+" = insert text, "%cutpat%" = cut text, "^" = return to start examples: mvp hse1.jpeg hse2.jpeg hse13.jpeg '%hse%+house+*.jpeg+.jpg+ mvp *.ps '+pref+*' -- add a prefix to all .ps files mvp file* '*+.dat+' -- add an extension to all 'file' files mvp sample_??.dat 'sample_+00+*' -- add two leading zeros to the sample number mvp a???_b???.dat '%a???_%b*.dat+_+^a???+.dat+' -- rename aXXX_bYYY.dat to bYYY_aXXX.dat